No subject

From: ()
Date: Sat Mar 24 01:50:51 EDT 2012

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

(define (kar z)
    (z 0))

(define (kdr z)
    (z 1))

Content-Type: text/html; charset=ISO-8859-7
Content-Transfer-Encoding: quoted-printable

<div>The code below (kons) gets flagged in R5RS: =A0</div><div><br></div><d=
iv>define: not allowed in an expression context in: (define dispatch (=EB (=
m) (cond ((=3D m 0) x) ((=3D m 1) y) (else (error &quot;Argument not 0 or 1=
 -- KONS&quot; m)))))</div>
<div><br></div><div>Works fine if I replace the lambda symbols with &quot;l=
><div><br></div><div>From page 91 in SICP (slightly modified):</div>
<div><br></div><div>(define kons (=EB (x y)</div><div>=A0 =A0 (define dispa=
tch (=EB (m)</div><div>=A0 =A0 =A0 =A0 (cond ((=3D m 0) x)</div><div>=A0 =
=A0 =A0 =A0 =A0 =A0 =A0 ((=3D m 1) y)</div><div>=A0 =A0 =A0 =A0 =A0 =A0 =A0=
 (else (error &quot;Argument not 0 or 1 -- KONS&quot; m)))))</div>
<div>=A0 =A0 dispatch))</div><div><br></div><div>(define (kar z)</div><div>=
=A0 =A0 (z 0))</div><div><br></div><div>(define (kdr z)</div><div>=A0 =A0 (=
z 1))</div><div><br></div>


Posted on the users mailing list.