David Kastrup <d...@gnu.org> writes:

> "m...@apollinemike.com" <m...@apollinemike.com> writes:
>>
>> If one defines a music function incorrectly and then tries to use it, i.e. :
>>
>> foo =
>> #(define-music-function (parser location)
>> #{ a #})
>>
>> \foo
>>
>> One gets the following warning message:
>>
>> Parsing...
>> foo.ly:4:1: error: GUILE signaled an error for the expression beginning here
>> #
>>  (define-music-function (parser location)
>> Unbound variable: clone
>> fatal error: failed files: "foo.ly"

> define-music-function could possibly try to check for the most likely
> programming errors and turn them into an error explicitly.
>
> Frog task.

Well, for a frog liking scheming.  ly:make-music-function is too late,
and the body of define-syntax-function is partly not late enough (it's
not in the right lexical context to look at the defined-ness of
symbols), partly too late (if the whole macro replacement contains
undefined symbols later on, creating a useful error message at its start
might prove tricky).

Well, at least the guile command line has no problem with
(and #f barf barf barf)
so if one uses the right special forms, one might escape this niggle.

-- 
David Kastrup


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

Reply via email to