The code below (kons) gets flagged in R5RS:

define: not allowed in an expression context in: (define dispatch (λ (m)
(cond ((= m 0) x) ((= m 1) y) (else (error "Argument not 0 or 1 -- KONS"
m)))))

Works fine if I replace the lambda symbols with "lambda".

Cause?

Michael

=============

>From page 91 in SICP (slightly modified):

(define kons (λ (x y)
    (define dispatch (λ (m)
        (cond ((= m 0) x)
              ((= m 1) y)
              (else (error "Argument not 0 or 1 -- KONS" m)))))
    dispatch))

(define (kar z)
    (z 0))

(define (kdr z)
    (z 1))
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to