[gambit-list] (define ((...) ...)
Michele Zaffalon
michele.zaffalon at gmail.com
Tue Aug 25 20:45:55 EDT 2009
On Tue, Aug 25, 2009 at 8:36 PM, Marc Feeley<feeley at iro.umontreal.ca> wrote:
> Try the following, which does not require define-syntax:
>
> (define-macro (define pattern . rest)
> (if (pair? pattern)
> `(define ,(car pattern) (##lambda ,(cdr pattern) , at rest))
> `(##define ,pattern , at rest)))
>
> (define (((f x) y) z)
> (+ x y z))
>
> (define g (f 1))
> (define h (g 2))
> (pp (h 10))
>
> Marc
Thanks.
michele
More information about the Gambit-list
mailing list