Mark Knoop <m...@opus11.net> writes:

> In this instance single number lists are not relevant anyway. So I've
> tried this method:
>
> #(define (multi-number-list? x)
>   (and (list? x)
>        (< 1 (length x))
>        (every number? x)))
>
> testfn = #(define-void-function
>   (a) (multi-number-list?)
>   (print "\na=~s length=~s\n" a (length a)))
>
> {
>   % this works
>   \testfn #'(1 2 3)
>   % this doesn't - why?
>   \testfn 1,2,3
>   % this fails as expected
>   \testfn 1
> }
>
> ...and was surprised to see that the new list syntax doesn't work in
> this instance. It's not clear to me at what point lilypond/guile
> decides that something is a list or not.

LilyPond does not try for a list if a single-element list does not work.
Because that decision would result in lookahead which is something it
cannot do in the context of optional arguments.  It needs to make a
decision earlier than that.

So, uh, my advice was not particularly useful.

Sorry for that.

-- 
David Kastrup

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

Reply via email to