[Larceny-users] Object systems and macro transformers

TJ tjay.dreaming at gmail.com
Tue Mar 6 05:06:49 EST 2007


Hi everyone, I'm new here so please forgive me if the questions I'm
about to ask have already been asked too many times. Plus I'm no
Scheme guru so feel free to point out any mistakes I make :-)

1. Are there any object systems for Larceny? Preferably CLOS style
systems. If not, how do I adapt tinyclos for use in Larceny?

2. How do I use the procedure (environment-set-macro! ...) ? If I call
it like this:

(environment-set-macro! (interaction-environment)
                        'my-when
                        (syntax-rules ()
                          ((_ pred e1 e2 ...)
                           (if pred
                               (begin e1 e2 ...)))))

I get:

BUG in macro expander:
Bug detected in m-expand
special
(syntax-rules () ((_ pred e1 e2 ...) (if pred (begin e1 e2 ...))))
#f

However if I use the (syntax-rules ...) with define-syntax, as such:

(define-syntax my-when
  (syntax-rules ()
    ((_ pred e1 e2 ...)
     (if pred
        (begin e1 e2 ...)))))

then it works fine.


Cheers,

TJ



More information about the Larceny-users mailing list