[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: why tail recursion matters and why Java isn't it, was Re: lispperformance was Re: problems with lisp
>>>>> "Pascal" == Pascal Costanza <email@example.com> writes:
Pascal> Shriram Krishnamurthi wrote:
>> Pascal Costanza <firstname.lastname@example.org> asks in what I can only
>> hope is a fit of passion overcoming rational thought:
>>> Why should it be important to cover all cases?
>> Because programming language designers should not think they are a
>> whole lot smarter than the programmers who will use their language.
>> (Note: This wording even accommodates the design of Arc.)
Pascal> I totally agree. Are language designers who don't include loop
Pascal> constructs in a language a "whole lot smarter" than the programmers
Pascal> who will use their language?
You keep changing your standpoint: Previously, you were saying that
programming languages should restrict the ways people can form
loop-like programs. (Or at least you were creating a strong
impression that you were.) Now you're saying it's about including
additional abstractions. Which is it?
The real issue with LOOP and most other looping constructs is (as
Matthias pointed out), that "looping" almost always is about the
structure of the data, namely about the structure of self-referential
data. Recursive programs simply reflect that fact by having a
recursive call on the self-reference---it's a clear and
straightforward way of writing such programs. "Loop constructs"
generally obscure that issue.
This is why Scheme has largely eschewed looping constructs---hardly
anyone ever uses DO. The abstractions for doing the things you
mentioned are data-centric---things like MAP and FOLD.
Sure, people raised on loops have trouble "getting it," mostly because
of the method and the examples by which they were taught. Taught
properly, 5th-graders can get recursion, with less effort than it
would take to teach them about looping constructs.
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla