[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).
signature.asc
Description: This is a digitally signed message part
- error Wrong type to apply: #<syntax-transformer, Damien Mattei, 2023/08/03
- Re: error Wrong type to apply: #<syntax-transformer, Maxime Devos, 2023/08/08
- Re: error Wrong type to apply: #<syntax-transformer, Damien Mattei, 2023/08/08
- Re: error Wrong type to apply: #<syntax-transformer, Jean Abou Samra, 2023/08/08
- Re: error Wrong type to apply: #<syntax-transformer, Maxime Devos, 2023/08/09
- Re: error Wrong type to apply: #<syntax-transformer, Maxime Devos, 2023/08/09
- Re: error Wrong type to apply: #<syntax-transformer, Jean Abou Samra, 2023/08/09