[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 (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 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 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 -

LilyPond Software Design
 -- Code for Music Notation

reply via email to

[Prev in Thread] Current Thread [Next in Thread]