[gambit-list] Can one use define-macro in Gerbil?

Dimitris Vyzovitis vyzo at hackzen.org
Wed Apr 15 04:59:34 EDT 2020


define-macro is supported only within begin-foreign (or begin-ffi) blocks,
where you drop to pure gambit.

-- vyzo

On Wed, Apr 15, 2020 at 11:52 AM Lassi Kortela <lassi at lassi.io> wrote:

> Thanks for sticking around, Iain. It's not a dumb question. Scheme
> macros are unusually difficult to understand especially since the macro
> systems are many and varied. Even experts have trouble with the finer
> points now and then.
>
> Re: Gambit and Gerbil, Gambit follows Scheme standards (R5RS and R7RS)
> faithfully and adds only a minimal number of its own concepts to the
> language, focusing more on efficiency. The main ones are:
>
> - threads
> - versatile ports (not just byte and character ports)
> - weak references
> - keyword arguments and keyword objects
> - various introspection facilities
>
> These are useful augmentations but do not change the essential
> programming style or "flair" of classic Scheme.
>
> By contrast, Gerbil is much more adventurous with the core language,
> notably adding actors and methods which are a big conceptual leap. (As
> an amusing coincidence, Wikipedia tells us that Scheme was originally
> invented as a tool to study the Actor model way back in the 1970s, so I
> guess Gerbil brings it full circle :)
>
> As for define-macro, it seems to exist in Gerbil but doesn't work the
> same way it does in pure Gambit:
>
> Gerbil v0.15.1 on Gambit v4.9.3
>  > (define-macro (foo x y) `(+ ,x ,y))
>  > (foo 2 3)
> *** ERROR IN (console)@2.1 -- Ill-formed expression
>
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> https://mailman.iro.umontreal.ca/cgi-bin/mailman/listinfo/gambit-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20200415/e39b6fce/attachment.htm>


More information about the Gambit-list mailing list