Re: Music function returning *unspecified*

David Kastrup <[email protected]>
Newsgroups gmane.comp.gnu.lilypond.devel
Message-ID <[email protected]>
Dan Eble <[email protected]> writes:

> Are there any potential drawbacks to allowing music functions to
> return *unspecified* and having the infrastructure map it to
> (make-music 'Music)?
>
> The main advantage is that something like
>
>     (if condition
>         (begin
>          ...
>          ...)
>         (make-music 'Music))
>
> could instead be written
>
>     (when condition
>       ...
>       ...)
>
> I believe that this can be done; I'm asking whether there is any
> reason that it shouldn't be done.

I think it is a bad idea.

In general #*unspecified inside of a music expression is elided.
(make-music 'Music) isn't.  It prints under \displayMusic, it takes
articulations.  It has non-trivial side effects and should not be
silently inserted for what may likely be lackadaisical coding without a
clear idea of what is happening.

-- 
David Kastrup
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.