For Programmers: Free Programming Magazines  


Home > Archive > Scheme > March 2007 > newbie's question









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author newbie's question
Matthew Zhou

2007-03-18, 7:10 pm

I am starting to read the book "Structure and Interpretation of
Computer Programs" with MIT Scheme on hand. I am just starting and
read a section called "Applicative order versus normal order". I tried
this exercise 1.5 (below)

(define (p) (p))
(define (test x y)
(if (= x 0)
0
y))

(test 0 (p))

I find that MIT Scheme just went into an infinite loop without ever
stopping. So I think MIT Scheme is using the so-called normal
order. So, my question is which implementation of scheme is using the
applicative order?
Emilio Lopes

2007-03-18, 7:10 pm

Matthew Zhou writes:

> (define (p) (p))
> (define (test x y)
> (if (= x 0)
> 0
> y))


> (test 0 (p))


> I find that MIT Scheme just went into an infinite loop without ever
> stopping. So I think MIT Scheme is using the so-called normal
> order. So, my question is which implementation of scheme is using the
> applicative order?


Could it be, that you are confusing the meaning of the terms
"applicative" and "normal"? :-)

To answer your question: no "usual" Scheme implementation uses the
"other" evaluation strategy, but such an interpreter will be built
later in the book.

--
Emílio C. Lopes Ich leb und weiß nit wie lang,
Munich, Germany ich stirb und weiß nit wann,
ich fahr und weiß nit wohin,
(Martinus von Biberach) mich wundert, dass ich fröhlich bin!

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com