Re: Control the order of expansion of syntax-case macros

2024-12-20 Thread Zelphir Kaltstahl
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 () (_

Re: Control the order of expansion of syntax-case macros

2024-12-20 Thread Vivien Kraus
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: >  

Re: Control the order of expansion of syntax-case macros

2024-12-20 Thread Nala Ginrut
> > > 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

RE: Control the order of expansion of syntax-case macros

2024-12-20 Thread Maxime Devos via General Guile related discussions
>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

Control the order of expansion of syntax-case macros

2024-12-17 Thread Vivien Kraus
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")