[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (lambda ( . rest))
From: |
Reinhold Kainhofer |
Subject: |
Re: (lambda ( . rest)) |
Date: |
Sun, 21 Dec 2008 03:45:05 +0100 |
User-agent: |
KMail/1.10.3 (Linux/2.6.27-9-generic; KDE/4.1.3; i686; ; ) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Am Sonntag, 21. Dezember 2008 03:18:48 schrieb Bertalan Fodor:
> Hi,
>
> I found this in lilypond-book-preamble.ly:
>
> (lambda ( . rest)
>
> Besides that I can't imagine what that wants to mean, the GUILE doc
> clearly says:
>
> --- syntax: *lambda* formals body
>
> |(|variable1| ... |variablen| . |variablen+1|)|
>
> There must be at least one argument before the period.
>
> It seems clear that GUILE accept that strange form. But not any of my
> Java-based parsers.
Neither GUILE nor MIT-Scheme are documented to allow this form of optional
parameters (actually, both disallow it explicitly in the docs).
Wouldn't it be better to re-write the code to
#(define toplevel-book-handler
(lambda rest
(set! output-empty-score-list #f)
(apply print-book-with-defaults rest)))
(i.e. name the whole parameter expression rest instead of ( . rest ) and pass
that on)? I've not tested this, though, so I might be completely wrong, but
from the GUILE doc it seems that this does exactly the same as the
undocumented ( . rest) and is documented to work.
Cheers,
Reinhold
> What would you suggest to do with that?
- --
- ------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: address@hidden, http://reinhold.kainhofer.com/
* Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
* K Desktop Environment, http://www.kde.org, KOrganizer maintainer
* Chorvereinigung "Jung-Wien", http://www.jung-wien.at/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iD8DBQFJTa2yTqjEwhXvPN0RAviRAJ0eRgUlrOg3j7VRpIJfHERKcVKLhQCgje78
ao+TesZTPTXyVWbtgAmvofA=
=MWPM
-----END PGP SIGNATURE-----
- (lambda ( . rest)), Bertalan Fodor, 2008/12/20
- Re: (lambda ( . rest)),
Reinhold Kainhofer <=