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. -Patrick _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel