Hello Vivien
On 17.12.24 17:33, Vivien Kraus wrote:
Dear Guile users,
syntax-case macros can have cool side effects at expansion time.
However, they are still draped in a veil of mystery to me.
Consider this code:
(define-syntax hello
(lambda (stx)
(syntax-case stx ()
(_
Hello!
Le vendredi 20 décembre 2024 à 10:15 +0100, Maxime Devos a écrit :
> (define-syntax hello
> (lambda (stx)
> (syntax-case stx ()
> (_
> (begin
> (format (current-error-port) "Hello!\n")
> (datum->syntax #f "hello"))
>
> You can simplify this to:
>
>
>
> So my guess is that syntax objects are expanded lazily. Is there
> something I can do to get #'world expanded before #'hello?
>
More accurately, it's Normal Order for macro and special form (actually
it's another fancy name of internal implemented macro), you may want to
take a look through
>syntax-case macros can have cool side effects at expansion time.
>However, they are still draped in a veil of mystery to me.
> Consider this code:
(define-syntax hello
(lambda (stx)
(syntax-case stx ()
(_
(begin
(format (current-error-port) "Hello!\n")
(datum
Dear Guile users,
syntax-case macros can have cool side effects at expansion time.
However, they are still draped in a veil of mystery to me.
Consider this code:
(define-syntax hello
(lambda (stx)
(syntax-case stx ()
(_
(begin
(format (current-error-port) "Hello!\n")