chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] destructuring-bind?


From: John Cowan
Subject: Re: [Chicken-users] destructuring-bind?
Date: Sun, 4 Feb 2007 16:27:33 -0500
User-agent: Mutt/1.5.13 (2006-08-11)

Elliot Cuzzillo scripsit:

> Coming from CL, I'm used to having macro definitions use
> destructuring-bind in their argument lists, so that if we have
> (defmacro blah ((x y) z) ...) then if you call (blah (fee fi) fo) then
> x => fee, y => fi, and z=> fo.
> Does this exist in Chicken's macros, or elsewhere in Chicken?

Syntax-rules and its generalization syntax-case provide the equivalent
facilities in Scheme, and Chicken provides them both if you say
(use syntax-case), either at compile-time or in the interpreter.

There is an excellent tutorial on syntax-rules called "JRM's
Syntax-rules Primer for the Merely Eccentric".  Its normal home
is http://home.comcast.net/~prunesquallor/macro.txt , but it
seems to be offline at the moment, so I have uploaded a copy to
http://home.ccil.org/~cowan/temp/macro.txt .

-- 
May the hair on your toes never fall out!       John Cowan
        --Thorin Oakenshield (to Bilbo)         address@hidden




reply via email to

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