[Home] [Back to Message Index]

Global SchoolNet - Automated Message Archive

Re: LOGO-L> trouble with recursion




Brian Harvey (bh@CS.Berkeley.EDU)
Wed, 1 Jan 1997 12:51:22 -0800 (PST)

"Jean-Pierre L'Archeveque" <jplarch@odyssee.net> says:
> Unless sentence is a much more efficient list constructor than fput
> (which I doubt), there is surely an overhead.
> (Perhaps Brian Harvey would have more to say on this).

Glad to oblige. :-)

If one of the inputs to SENTENCE is the empty list, it just returns
the other input, so the *extra* calls cost only the time for a call
to a primitive procedure, which is nonzero but fairly small. The
calls that really do work are more expensive, though, because of the
extra call to LIST and a little recopying inside SENTENCE.

I expect that all of these costs are swamped by the cost of parsing
and evaluating the program text! In interpreted versions of Logo
(all but Object Logo, I think) this happens for each invocation.
---------------------------------------------------------------
Please post messages to the Logo forum to logo-l@gsn.org. Mail
questions about the list administration to logofdn@gsn.org. To
unsubscribe send unsubscribe logo-l to majordomo@gsn.org.