guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: error Wrong type to apply: #<syntax-transformer


From: Damien Mattei
Subject: Re: error Wrong type to apply: #<syntax-transformer
Date: Fri, 4 Aug 2023 14:45:34 +0200

yes :-) i will keep it in mind. It is a bit like a let* i tends to
forget it sometimes.

On Fri, Aug 4, 2023 at 10:31 AM Jean Abou Samra <jean@abou-samra.fr> wrote:
>
> Le vendredi 04 août 2023 à 10:23 +0200, Damien Mattei a écrit :
>
> i know what disturb me in this error, it is because the order of
> definitions has effect but i always learn (was it right?) that in
> scheme the order of definitions should have no effect on the resulting
> evaluations.
>
>
>
> Not really, you cannot do
>
> (define b (1+ a))
> (define a 5)
>
> either. You *can* do
>
> (define (b) (1+ a))
> (define a 5)
>
> but that's because the definition of b does not use the binding for a, only 
> capture it in a lambda abstraction. The reason you cannot do
>
> (define b (mac 1))
> (define-syntax-rule (mac x) x)
>
> is that the (mac 1) expression used in the binding of b is using the macro 
> (at expand time), just like in my first example it was using the variable a 
> (at runtime).
>
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]