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: Jean Abou Samra
Subject: Re: error Wrong type to apply: #<syntax-transformer
Date: Fri, 04 Aug 2023 10:31:53 +0200
User-agent: Evolution 3.48.4 (3.48.4-1.fc38)

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).




Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

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