FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
Architecture & Design
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
April 01, 2004

Building Little Languages with Macros

(Page 12 of 12)
Apr04: Building Little Languages With Macros


(a)
(define-syntax define-cbr
   (syntax-rules ()
      ((_ (id arg ...) body)
       (begin
          ???
          (define-syntax id
             (syntax-rules ()
               ((id actual (... ...))
                 (do-f (lambda () actual)
                       (... ...)
                       (lambda (v)
                          (set! actual v))
                       (... ...))         )))))))

(b)
(define (do-f get set)
   (define-get/set-var arg get set)
   body)

Example 9: define-cbr macro that expands.

Previous Page | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK