[CM] R7RS support

Iain Duncan iainduncanlists at gmail.com
Mon Jan 17 07:52:26 PST 2022


Hi Rudolf, Bill would be the person to address this better than me, but I
think the Egghead team should read through the s7.html page pretty closely
to see if s7 is a good fit. It's pretty clear in there that there is
*limited* R7RS compatibility, but that s7 is not R7RS and nor is that a
stated goal. For example, s7 does not do macros with syntax-case or
syntax-rules, but uses CL style macros. If R7RS is what you need, you might
be better off with an implementation that makes that a goal, such as Chibi.
I use s7 embedded in audio programs, which shares a fair bit of domain
space with games, and I personally chose s7 because the performance and
ease of embedding made up for that, but YMMV!

HTH
iain

On Mon, Jan 17, 2022 at 7:36 AM Rudolf Adamkovič <salutis at me.com> wrote:

> Hi there!
>
> At Egghead Games, we would like to use Scheme for in-app scripting.  We
> wired up s7 and SQLite to kick things off, but s7 support for R7RS does
> not seem to work.  Below, I include some examples to illustrate my
> point.
>
> A basic example from the R7RS standard, page 54, …
>
> (with-exception-handler
>     (lambda (x)
>       (display "something went wrong\n"))
>   (lambda ()
>     (+ 1 (raise ’an-error))))
>
> … results in:
>
> > Error: catch error handler should accept two arguments: #<lambda (x)>
>
> The simplest library …
>
> (load "r7rs.scm")
> (define-library (some lib)
>   (export some-proc)
>   (import (scheme base)
>           (scheme r5rs))
>   (begin
>     (define (some-proc x)
>       (display x))))
>
> … results in:
>
> > Error: symbol->value first argument, {gensym}-1, is a macro but should
> > be a symbol (define-macro ({gensym}-1 . names)...
>
> We picked s7 because the website says …
>
> > I believe it is compatible with r5rs and r7r
>
> … but per a quick grep, there seem to exist no tests for define-library
> or with-exception-handler.
>
> Any ideas?
>
> Rudy
> --
> "Logic is a science of the necessary laws of thought, without which no
> employment of the understanding and the reason takes place." -- Immanuel
> Kant, 1785
>
> Rudolf Adamkovič <salutis at me.com> [he/him]
> Studenohorská 25
> 84103 Bratislava
> Slovakia
>
> _______________________________________________
> Cmdist mailing list
> Cmdist at ccrma.stanford.edu
> https://cm-mail.stanford.edu/mailman/listinfo/cmdist
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20220117/9771d4da/attachment.html>


More information about the Cmdist mailing list