Hi,

I am trying to get into somewhat consistent music function behavior.
Some argument types for music functions inherently require lookahead:
simple music expressions like c4 (since you can still add -\accent at
will), symbol chains (like Bottom as it may be followed by
. Accidental), durations like 4. since further dots may follow.

If something like

\language "italiano"
sol

is supposed to work, strings may not require lookahead, or sol will not
be recognized in Italian mode.

In general, not requiring lookahead makes things more versatile.

Now there are things like 3\cm which I currently allow as function
arguments.  But that means that an unadorned 3 is not complete without
checking the lookahead for a number identifier.  I don't think there is
any function yet that actually uses numerical arguments like that, and
one can always get by with writing #(* 3 cm) or ##{ 3\cm #}.

Even if we have functions taking numeric arguments, it would likely be
surprising that something like

add = #(define-scheme-function (parser location a b) (number? number?)
     (+ a b))
y = 7
z = \add 4 \y

will complain since 4\y evaluates to 28 and no second numeric argument
follows.  Huh.

I lean towards letting numbers in function arguments just evaluate to
themselves, never mind units.  In particular integers are used quite
often in manners where a "unit" behavior of identifiers would be rather
more than less surprising.

-- 
David Kastrup


_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to