lilypond-devel
[Top][All Lists]
Advanced

[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 00:02:35 +0200
User-agent: Thunderbird 1.5.0.7 (X11/20061008)

Joe Neeman schreef:
Here is an attempt at making simple-closures pure-evaluatable. A
summary:

1) move the conversion of non-pure-to-pure callbacks into C++ where it
is a bit easier to access and generalise it to support functions other
than just grob callbacks. The convention is that if a non-pure function

I'm not sure about this ; why not in Scheme? (In general, we've had a movement of stuff out of C++, not back to C++).

takes (arg1 arg2 arg3) as arguments then the pure version will take
(arg1 start end arg2 arg3) as arguments. This order is so that we can
have arg3, for example, as an optional argument.


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).

I haven't actually written any new pure functions yet, so the impact is
fairly small. I'll try to do a pure_avoid_slur_callback before 2.10. I
should point out, though, that the main problem in issue #113 has been
mitigated somewhat by the fact that TextScripts usually use normal
procedures now for Y-offset.




--

Han-Wen Nienhuys - address@hidden - http://www.xs4all.nl/~hanwen

LilyPond Software Design
 -- Code for Music Notation
http://www.lilypond-design.com





reply via email to

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