Re: [stack] disallowing recursive definitions
John Cowan <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
William Tanksley, Jr scripsit: > I'm generally on Knuth's side on this one. Remember that Knuth thought Dijkstra was *mostly* right, and takes care to disclaim the notion that he is in favor of random gotos. AFAIK, gotos are only used in TeX to compensate for Pascal's lack of a return statement. > But I don't see how tail recursion is a general goto statement. It > seems structured -- in particular, a tail recursion has only one entry > point. If you take an arbitrary tagbody (a list of statements and labels with gotos embedded in the statements), you can restructure it into a sequence of functions, one per label, where each function ends by tail calling the next function in sequence (corresponding to flowing through the label) and each goto is changed into a tail call. This can be done entirely as a local transformation. So while it's true that tail calls have only one entry point, entry points and labels are basically the same thing from a Scheme perspective, something that neither Knuth nor Dijkstra deals with. "Lambda: the ultimate GOTO." -- Well, I have news for our current leaders John Cowan and the leaders of tomorrow: the Bill of [email protected] Rights is not a frivolous luxury, in force http://www.ccil.org/~cowan only during times of peace and prosperity. We don't just push it to the side when the going gets tough. --Molly Ivins