TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

On Iteration and Recursion [pdf]

54 pointsby alokraiabout 5 years ago

3 comments

carapaceabout 5 years ago
Five hand-written pages and no scratch-outs or corrections. And maybe I&#x27;m wrong but I&#x27;m pretty sure this wasn&#x27;t the Nth draft. I don&#x27;t doubt that he just sat down and wrote it out in one go.<p>(It&#x27;s so impressive it&#x27;s almost galling. He makes me feel just a little like Salieri, of Mozart.) <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Amadeus_(film)" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Amadeus_(film)</a>
评论 #23074214 未加载
评论 #23070665 未加载
评论 #23071622 未加载
评论 #23072492 未加载
a1369209993about 5 years ago
&gt; the syntax for natural numbers, for which there are at least three forms<p>No, this incorrect[0]; consider the number 102, which under the second parse rule yields first the natural number 2, to which a zero is prepended, giving 02, aka... 2; prepending a 1 then produces 12, which is clearly wrong. The third rule has the same problem, nondeterministicly. Only the first rule is correct, producing 1,10,102, by successive multiplication by ten and addition of intermediate digits.<p>This is similar to defining subtraction with:<p><pre><code> sum ::= term sum ::= term &#x27;-&#x27; sum </code></pre> it may happen to match the same strings, but parsing &quot;1-2-3&quot; as 1-(2-3) produces 2 rather than -4.<p>It&#x27;s not clear that chop shares this problem, but personally I would much prefer:<p><pre><code> chop 0 x = x chop (S n) (p:q) = chop n q </code></pre> 0: or least, you&#x27;d need two forms other than the ones provided for &quot;at least three&quot; to be true
评论 #23072816 未加载
zozbot234about 5 years ago
(1982), see last page