mit-scheme-users
[Top][All Lists]
Advanced

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

Re: Is Scheme pure applicative order evaluation strategy?


From: Nicholas Papadonis
Subject: Re: Is Scheme pure applicative order evaluation strategy?
Date: Wed, 18 Mar 2020 17:34:48 -0400

So far I found this page:
http://community.schemewiki.org/?sicp-ex-1.6

"The act of re-defining a special form using generic arguments effectively "De-Special Forms" it. It then becomes subject to applicative-order evaluation, such that any expressions within the consequent or alternate portions are evaluated regardless of the predicate."

Therefore it appears Scheme is applicative order except for special forms like "if"?

Thanks

On Wed, Mar 18, 2020 at 4:23 PM Nicholas Papadonis <address@hidden> wrote:
It seems that if the second argument to if is not evaluated.  Thanks!

(define (try a b)
  (if (= a 0) 1 b))
;Value: try

; Looks like applicative order evaluation:
(try 0 (/ 1 0))
;Division by zero signalled by /.

; Looks like normal order evaluation from the left
(if (= 1 1) 1 (/ 1 0))
;Value: 1

; How is it implemented?
(pp if)
;Syntactic keyword may not be used as an _expression_: #[keyword-value-item 16]

reply via email to

[Prev in Thread] Current Thread [Next in Thread]