Edge case in SRFI-139 Jakub T. Jankiewicz (28 Jan 2024 11:46 UTC)
Re: Edge case in SRFI-139 Marc Nieper-Wißkirchen (28 Jan 2024 12:31 UTC)
Re: Edge case in SRFI-139 Jakub T. Jankiewicz (28 Jan 2024 14:09 UTC)
Re: Edge case in SRFI-139 Marc Nieper-Wißkirchen (28 Jan 2024 14:43 UTC)
Re: Edge case in SRFI-139 Jakub T. Jankiewicz (28 Jan 2024 16:12 UTC)
Re: Edge case in SRFI-139 Marc Nieper-Wißkirchen (28 Jan 2024 16:20 UTC)
Re: Edge case in SRFI-139 Jakub T. Jankiewicz (28 Jan 2024 16:22 UTC)
Re: Edge case in SRFI-139 Marc Nieper-Wißkirchen (28 Jan 2024 16:28 UTC)
Re: Edge case in SRFI-139 Jakub T. Jankiewicz (28 Jan 2024 17:56 UTC)
Re: Edge case in SRFI-139 Jakub T. Jankiewicz (28 Jan 2024 16:39 UTC)
Re: Edge case in SRFI-139 Shawn Wagner (28 Jan 2024 16:57 UTC)

Re: Edge case in SRFI-139 Jakub T. Jankiewicz 28 Jan 2024 14:09 UTC

Only Racket give an error when there are no define-syntax-parameter, the
other implementations mention in SRFI (Guile and Chibi) doesn't require it
to work. So I just leave it out. The code works the same if there
define-syntax-parameter.

So what should be the output of there is define-syntax-parameter?

On Sun, 28 Jan 2024 13:31:27 +0100
Marc Nieper-Wißkirchen <xxxxxx@gmail.com> wrote:

> Your code is an error, so any behaviour is allowed (according to the
> R7RS).  The problem with your code is that `syntax-parameterize` can only
> be applied to identifiers that are bound by `define-syntax-parameter`.  In
> your code, the identifier `it` in the macro body (which becomes
> hygienically renamed to, say, `it*`) is unbound.
>
>
> Am So., 28. Jan. 2024 um 12:46 Uhr schrieb Jakub T. Jankiewicz - jcubic at
> onet.pl (via srfi-discuss list) <xxxxxx@srfi.schemers.org>:
>
> > Hi,
> >
> > What should be the output of this code:
> >
> > (define (print x . rest)
> >   (apply display x rest)
> >   (newline))
> >
> > (define-syntax foo
> >   (syntax-rules ()
> >     ((_ body ...)
> >      (begin
> >        (syntax-parameterize
> >         ((it (syntax-rules ()
> >                ((_) "hello world"))))
> >         (print it)
> >         body ...)))))
> >
> > (let ((it 10))
> >   (foo (print it)))
> >
> >
> > I only tested in two implementations Chibi and Guile.
> > Guile give an error but Chibi first print 10.
> >
> > My implementation prints 10 10.
> >
> > Jakub
> >
> > --
> > Jakub T. Jankiewicz, Senior Front-End Developer
> > https://jcubic.pl/me
> > https://lips.js.org
> > https://koduj.org
> >

--
Jakub T. Jankiewicz, Senior Front-End Developer
https://jcubic.pl/me
https://lips.js.org
https://koduj.org