Sorry if this is a dumb question. I know that Gambit supports CL style macros with define-macro, and see it's not mentioned on the Gerbil site, but I'm wondering if that's means it's not possible or just not officially supported. Reason being that I'm writing code using it in S7 scheme and in a perfect world, my project would have a second scheme implementation other than the default (S7), but for that to make sense I should probably be able to run define-macro code on it.
thanks iain
Afficher les réponses par date
On Apr 12, 2020, at 12:07 PM, Iain Duncan iainduncanlists@gmail.com wrote:
Sorry if this is a dumb question. I know that Gambit supports CL style macros with define-macro, and see it's not mentioned on the Gerbil site, but I'm wondering if that's means it's not possible or just not officially supported. Reason being that I'm writing code using it in S7 scheme and in a perfect world, my project would have a second scheme implementation other than the default (S7), but for that to make sense I should probably be able to run define-macro code on it.
thanks iain
Why do you need to support Gerbil as a “second Scheme implementation”? You could use plain Gambit for that given that S7 is a rather minimal (not quite R7RS) Scheme implementation.
Marc
Thanks Mark, That is also a possibility, but I just didn't have that question as I already know define-macro is supported in Gambit. These are very much hypothetical questions at this point, but I was curious about the macro issue. I don't really know (and won't for some time) what potential users might want to see that is not in S7, hence the looking around.
thanks
On Sun, Apr 12, 2020 at 9:26 AM Marc Feeley feeley@iro.umontreal.ca wrote:
On Apr 12, 2020, at 12:07 PM, Iain Duncan iainduncanlists@gmail.com
wrote:
Sorry if this is a dumb question. I know that Gambit supports CL style
macros with define-macro, and see it's not mentioned on the Gerbil site, but I'm wondering if that's means it's not possible or just not officially supported. Reason being that I'm writing code using it in S7 scheme and in a perfect world, my project would have a second scheme implementation other than the default (S7), but for that to make sense I should probably be able to run define-macro code on it.
thanks iain
Why do you need to support Gerbil as a “second Scheme implementation”? You could use plain Gambit for that given that S7 is a rather minimal (not quite R7RS) Scheme implementation.
Marc
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
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@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@iro.umontreal.ca https://mailman.iro.umontreal.ca/cgi-bin/mailman/listinfo/gambit-list
Re: concurrency and actors, Gambit's extension Termite Scheme should be mentioned as well. http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.125.1527&rep=rep1&type=pdf
Thanks everyone, answers much appreciated. iain
On Wed, Apr 15, 2020 at 2:01 AM Lassi Kortela lassi@lassi.io wrote:
Re: concurrency and actors, Gambit's extension Termite Scheme should be mentioned as well. < http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.125.1527&rep=re...
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://mailman.iro.umontreal.ca/cgi-bin/mailman/listinfo/gambit-list