On Thu, Jan 24, 2008 at 09:08:11AM -0800, Mark Schoonover wrote:

So, is Scheme normal or applicative order? Since it the interpretor simply
kept going, it's telling me it's normal order. Funny thing is, it never quit
running, you'd think it would eventually run out of memory or something.
Maybe I didn't let it go long enough?

Quoting SICP:

  This alternative ``fully expand and then reduce'' evaluation method is
  known as normal-order evaluation, in contrast to the ``evaluate the
  arguments and then apply'' method that the interpreter actually uses,
  which is called applicative-order evaluation.

Scheme is definitely applicative-order, as are most programming languages.

Scheme requires a special performance characteristic concerning tail
recursion (which is discussed later).  All scheme interpreters are required
to evaluate 'p' in such a way that it never consumes memory.  In fact, this
technique is how we will later make loops.

David

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to