Re: Does declaration order matter in guile?

2023-02-14 Thread Dr. Arne Babenhauserheide
wolf writes: >> 1. You bind 'foo' to the syntax transformer. >> >> 2. During the compilation of (foo y), the compiler calls the syntax >> transformer to >>affect the generation of code, so it will do the right thing. > > Interesting, I think I understand the difference. So in some ways

Re: Does declaration order matter in guile?

2023-02-14 Thread wolf
Hello, first, let me thank you for thorough explanation, it helped and I (hopefully) now have better understanding. Few more questions are below. On 2023-02-12 20:52:16 +0100, Taylan Kammer wrote: > On 12.02.2023 19:46, wolf wrote: > > > So, I have few questions I would like to ask: > > > > 1.

Re: Does declaration order matter in guile?

2023-02-13 Thread Maxime Devos
On 12-02-2023 19:46, wolf wrote: Also, I could not help to notice that when I use R6RS records it does work regardless of the order: (use-modules (rnrs records syntactic)) (define (x y) (display (q-foo y)) (newline)) (define-record-type q (fields

Re: Does declaration order matter in guile?

2023-02-13 Thread Maxime Devos
On 13-02-2023 09:05, Sascha Ziemann wrote: You also can not ask Scheme about macros, because macros are not first-class-citizens. > > > This might be interesting: > https://matt.might.net/articles/metacircular-evaluation-and-first-class-run-time-macros/ You actually can ask (Guile)Scheme

Re: Does declaration order matter in guile?

2023-02-13 Thread Dr. Arne Babenhauserheide
Sascha Ziemann writes: > Am So., 12. Feb. 2023 um 20:52 Uhr schrieb Taylan Kammer > : >> >> On 12.02.2023 19:46, wolf wrote: >> >> > 1. When does order matter? What is going on here? >> >> The order matters in this case because the SRFI-9 implementation in Guile >> defines >> syntax (macros)

Re: Does declaration order matter in guile?

2023-02-13 Thread Sascha Ziemann
Am So., 12. Feb. 2023 um 20:52 Uhr schrieb Taylan Kammer : > > On 12.02.2023 19:46, wolf wrote: > > > 1. When does order matter? What is going on here? > > The order matters in this case because the SRFI-9 implementation in Guile > defines > syntax (macros) rather than just variables bound to

Re: Does declaration order matter in guile?

2023-02-12 Thread Taylan Kammer
On 12.02.2023 19:46, wolf wrote: > So, I have few questions I would like to ask: > > 1. When does order matter? What is going on here? Heya. The order matters in this case because the SRFI-9 implementation in Guile defines syntax (macros) rather than just variables bound to procedures. If

Does declaration order matter in guile?

2023-02-12 Thread wolf
Hello, I had encountered interesting thing yesterday, which challenged my understanding of guile (scheme). I always assumed that order of definitions in scheme does not matter, as long as everything if defined when it is running. So this should (and does) work: (define (x) (y)) (define