[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] compiler docs
From: |
felix winkelmann |
Subject: |
Re: [Chicken-hackers] compiler docs |
Date: |
Sun, 3 Jun 2007 09:45:13 +0200 |
On 6/2/07, Peter Keller <address@hidden> wrote:
Thank you!
You're welcome. Note that this is still incomplete.
In the first pass of the compilation of the N-queens problem, I see this:
(let ((t15 (set! dec-to1
(lambda (n4)
(##core#app
(let ((loop5 (##core#undefined)))
(let ((t8 (set! loop5
(lambda (i6 l7)
(if (= i6 '0) l7 (loop5 (- i6 '1) (cons
i6 l7)))))))
(let () loop5)))
n4
'())))))
What is t15? You seem to be having set! return a value of some kind and
always capturing it.
It is just a temporary. Every expression has a result value, and "begin"
is internally expanded into a sequence of nested "let" forms. In the
further flow of the code, the temporary is ignored.
Also, how is match.scm used and where can I find a good document on how to use
what that file implements?
By using match (via "(declare (uses ...))" in csi.scm and chicken.scm,
the pattern
matching macros are registered.
cheers,
felix