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

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

Is Scheme pure applicative order evaluation strategy?


From: Nicholas Papadonis
Subject: Is Scheme pure applicative order evaluation strategy?
Date: Wed, 18 Mar 2020 16:23:35 -0400

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]