[gambit-list] equal greater symbol
Marc Feeley
feeley at iro.umontreal.ca
Sun Oct 8 20:16:49 EDT 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 8-Oct-06, at 6:35 PM, Aycan iRiCAN wrote:
> Hi,
>
> What is the meaning of '=> symbol used in cond forms?
>
> Best Regards,
In Scheme the form
(cond (X => F)
...)
is equivalent to
(let ((x X))
(if x
(F x)
(cond ...)))
This is useful when the result of the test (the expression X) is
needed in the clause selected. This is frequently used in code like
(cond ((assoc X Y) => cdr)
...)
Marc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)
iD8DBQFFKZTx//V9Zc2T/v4RAiDxAJ4hIuljNHsGFIcVFr/I6cxr8CHmwgCfc1w8
s4rxaA/zU54hxeNXGbNpml4=
=B/Uz
-----END PGP SIGNATURE-----
More information about the Gambit-list
mailing list