[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pure simple-closures
From: |
Han-Wen Nienhuys |
Subject: |
Re: pure simple-closures |
Date: |
Sat, 21 Oct 2006 12:15:53 +0200 |
User-agent: |
Thunderbird 1.5.0.7 (X11/20061008) |
Joe Neeman schreef:
Mostly because at the time that I wrote it, I couldn't figure out how to
handle arbitrary length argument lists in scheme (the only way I
currently know is to build the list of arguments, cons in the function
I think you're looking for the apply function,
(apply func arg-list)
2) adopt the convention that if any argument in a simple-closure is
UNDEFINED, the entire closure is UNDEFINED. This allows us to abort the
evaluation of a pure closure when there is an unpure function with no
pure equivalent. This requires changing the SCM_UNDEFINED in
grob-closure.cc to scm_from_int(0).
Isn't there another value you could use for that?
SCM_UNDEFINED is also used for callbacks with optional arguments (grep
for OPTARGS).
It seems that in every OPTARGS callback, the optional argument defaults
to zero. The only difference in changing grob-closure.cc is that
outside_slur_callback will now return zero instead of SCM_UNDEFINED in a
few cases. But then Grob::get_offset will interpret the SCM_UNDEFINED as
zero anyway.
>
In the context of [XY]-offset, a non-procedure, non-number value is
interpreted as zero. So I don't think there is any confusion in
interpreting them as zero in chain_offset_callback.
OK; Just make sure that we can still chain procedures with non-number
return values.
--
Han-Wen Nienhuys - address@hidden - http://www.xs4all.nl/~hanwen
LilyPond Software Design
-- Code for Music Notation
http://www.lilypond-design.com
- pure simple-closures, Joe Neeman, 2006/10/20
- Re: pure simple-closures, Han-Wen Nienhuys, 2006/10/20
- Re: pure simple-closures, Joe Neeman, 2006/10/21
- Re: pure simple-closures,
Han-Wen Nienhuys <=
- Re: pure simple-closures, Joe Neeman, 2006/10/21
- Re: pure simple-closures, Han-Wen Nienhuys, 2006/10/21
- Re: pure simple-closures, Joe Neeman, 2006/10/22
- Re: pure simple-closures, Han-Wen Nienhuys, 2006/10/22
- Re: pure simple-closures, Han-Wen Nienhuys, 2006/10/22
- Re: pure simple-closures, Han-Wen Nienhuys, 2006/10/28