lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On this day of 03/15/2007 06:00 AM, Mike Pall saw fit to scribe:
> Hi,
> 
> David Haley wrote:
>> Can anybody explain why he claims that Java has no recursion?
> 
> It doesn't do tail-call elimination. When you come from the
> Scheme or ML school of thought, this means it's completely
> inadequate. 

This is true, but I don't think it proves Joel's point. So fine, it
might be inadequate in practice for certain kinds of problems. You can
still teach recursion, though, and then illustrate it with Java code.
You will, in practice, be limited to problems that have a certain
maximum depth of recursion (as a function of how big your stack can
grow), but I still don't see how this is a barrier to understanding
recursion as a concept.

(For the record, I'm not an advocate of Java, although I do some of my
work in it. I just think it's getting bashed a little unfairly. You
could substitute Java for any language whose compiler or interpreter
doesn't support tail-call elimination, and I would argue the same.)

> Another proof of the Sapir-Whorf hypothesis [*].

For whom -- Java-ites who can't possibly understand recursion, or
Scheme-ites who think nobody else can? :-)

Cheers,
- David

-- 
~David-Haley
http://david.the-haleys.org