lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Variable argument type to music function


From: Carl D. Sorensen
Subject: Re: Variable argument type to music function
Date: Thu, 11 Dec 2008 20:27:40 -0700



On 12/11/08 8:24 PM, "Patrick McCarty" <address@hidden> wrote:

> Hi Carl,
> 
> On Thu, Dec 11, 2008 at 08:04:32PM -0700, Carl D. Sorensen wrote:
>> I'm trying to allow predefine fret diagrams to use the verbose style as well
>> as the terse style.
>> 
>> I'd like to pass a diagram-definition to a music function that can be either
>> a list or a string.  If it's a list, I'll treat the definition as a verbose
>> definition.  If it's a string, I'll treat it as a terse definition.  I've
>> got everything in place except for the data type check.
>> 
>> What kind of a type check can I use to see if a variable is a list (or pair)
>> or a string?
>> 
>> I'm after something like:
>> 
>> (define-music-function (parser location key-symbol tuning shape-definition)
>>    (symbol? pair? ????)
>> 
>> Where ??? would be the true for either a pair or a string.
> 
> There are a few custom type predicates in scm/c++.scm, but this one is
> not there.  You could define a new type predicate (pair-or-string?)
> modeled after these ones, I suppose.


Thanks, Patrick!

Carl





reply via email to

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