[racket] Formal Presentation and initial doubts.

From: Eli Barzilay (eli at barzilay.org)
Date: Sun Apr 6 06:02:32 EDT 2014

About two weeks ago, Daniel Prager wrote:
> > Does… CL have a pattern-based macro syntax like syntax-rules? 
> 
> Not buit-in.

It does have a way of doing something similar to patterns, though less
sophisticated -- the argument list of a macro is actually used with
`destructuring-bind', so you can do things like

    CL-USER(1): (defmacro bind ((var val) &body body)
                  `(let ((,var ,val)) , at body))
    BIND
    CL-USER(2): (bind (x 1) (+ x 2))
    3

It's missing keyword matching, the magical `...', and, of course, it's
not limited to just rewrite rules.  But that's as irrelevant as
pattern matching is to `syntax-case' discussions.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the users mailing list.