[ << Notation manual tables ] | [Top][Contents][Index] | [ Cheat sheet >> ] |
[ < Naming conventions ] | [ Up: Notation manual tables ] | [ R5RS primary predicates > ] |
B.24 Predefined type predicates
Predicates return #t
(true) if their argument is of the named type
and #f
(false) if it isn’t.
B.24.1 R5RS primary predicates | ||
B.24.2 R5RS secondary predicates | ||
B.24.3 Guile predicates | ||
B.24.4 LilyPond scheme predicates | ||
B.24.5 LilyPond exported predicates |
[ << Notation manual tables ] | [Top][Contents][Index] | [ Cheat sheet >> ] |
[ < Predefined type predicates ] | [ Up: Predefined type predicates ] | [ R5RS secondary predicates > ] |
B.24.1 R5RS primary predicates
Primary predicates can be applied to any expression. They can be used on their own as predicates for LilyPond functions. The predicates here are part of the Scheme standard R5RS.
Type predicate Description boolean?
boolean char?
character complex?
complex number eof-object?
end-of-file object input-port?
input port integer?
integer list?
list (use cheap-list?
for faster processing)null?
null number?
number output-port?
output port pair?
pair port?
port procedure?
procedure rational?
rational number real?
real number string?
string symbol?
symbol vector?
vector
[ << Notation manual tables ] | [Top][Contents][Index] | [ Cheat sheet >> ] |
[ < R5RS primary predicates ] | [ Up: Predefined type predicates ] | [ Guile predicates > ] |
B.24.2 R5RS secondary predicates
Secondary predicates are only applicable to specific expressions (for example, to numbers). They will throw a type error when applied to expressions they are not intended for. The predicates here are part of the Scheme standard R5RS.
Type predicate Description char-alphabetic?
alphabetic character char-lower-case?
lower-case character char-numeric?
numeric character char-upper-case?
upper-case character char-whitespace?
whitespace character even?
even number exact?
exact number inexact?
inexact number negative?
negative number odd?
odd number positive?
positive number zero?
zero
[ << Notation manual tables ] | [Top][Contents][Index] | [ Cheat sheet >> ] |
[ < R5RS secondary predicates ] | [ Up: Predefined type predicates ] | [ LilyPond scheme predicates > ] |
B.24.3 Guile predicates
These predicates are defined by Guile but are not part of a Scheme standard.
Type predicate Description hash-table?
hash table
[ << Notation manual tables ] | [Top][Contents][Index] | [ Cheat sheet >> ] |
[ < Guile predicates ] | [ Up: Predefined type predicates ] | [ LilyPond exported predicates > ] |
B.24.4 LilyPond scheme predicates
These predicates are only available within LilyPond and defined in Scheme.
Type predicate Description alist?
association list (list of pairs) boolean-or-symbol?
boolean or symbol cheap-list?
list (use this instead of list?
for faster processing)color?
color exact-rational?
an exact rational number fraction?
fraction, as pair grob-list?
list of grobs index?
non-negative, exact integer index-or-markup?
index or markup key?
index or symbol key-list?
list of indices or symbols key-list-or-music?
key list or music key-list-or-symbol?
key list or symbol ly:skyline-pair?
pair of skylines markup?
markup markup-command-list?
markup command list markup-list?
markup list moment-pair?
pair of moment objects musical-length?
non-negative exact rational, fraction (as pair), moment, or +inf.0 musical-length-as-moment?
non-negative moment with no grace part musical-length-as-number?
non-negative exact rational or +inf.0 non-negative-number?
non-negative number number-list?
number list number-or-grob?
number or grob number-or-number-pair?
number or pair of numbers number-or-pair?
number or pair number-or-string?
number or string number-pair?
pair of numbers number-pair-list?
list of number pairs positive-fraction?
positive, finite fraction, as pair positive-musical-length?
positive exact rational, fraction (as pair), moment, or +inf.0 positive-musical-length-as-moment?
positive moment with no grace part positive-musical-length-as-number?
positive exact rational or +inf.0 positive-number?
positive number rational-or-procedure?
an exact rational or procedure rhythmic-location?
rhythmic location sane-simple-time-signature?
simple time signature sane-time-signature?
time signature scale?
non-negative rational, fraction, or moment scheme?
any type string-or-music?
string or music string-or-pair?
string or pair string-or-symbol?
string or symbol symbol-key-alist?
alist, with symbols as keys symbol-list?
symbol list symbol-list-or-music?
symbol list or music symbol-list-or-symbol?
symbol list or symbol time-signature?
time signature void?
void
[ << Notation manual tables ] | [Top][Contents][Index] | [ Cheat sheet >> ] |
[ < LilyPond scheme predicates ] | [ Up: Predefined type predicates ] | [ Cheat sheet > ] |
B.24.5 LilyPond exported predicates
These predicates are only available within LilyPond and usually defined in C++.
Type predicate Description ly:book?
book ly:context?
context ly:context-def?
context definition ly:context-mod?
context modification ly:dimension?
dimension, in staff space ly:dir?
direction ly:dispatcher?
dispatcher ly:duration?
duration ly:event?
post-event ly:font-metric?
font metric ly:grob?
graphical (layout) object ly:grob-array?
array of grobs ly:grob-properties?
grob properties ly:input-location?
input location ly:item?
item ly:iterator?
iterator ly:lily-lexer?
lily-lexer ly:lily-parser?
lily-parser ly:listener?
listener ly:moment?
moment ly:music?
music ly:music-function?
music function ly:music-list?
list of music objects ly:music-output?
music output ly:note-scale?
note scale ly:otf-font?
OpenType font ly:output-def?
output definition ly:page-marker?
page marker ly:pango-font?
Pango font ly:paper-book?
paper book ly:paper-system?
paper-system Prob ly:pitch?
pitch ly:prob?
property object ly:score?
score ly:skyline?
skyline ly:source-file?
source file ly:spanner?
spanner ly:spring?
spring ly:stencil?
stencil ly:stream-event?
stream event ly:transform?
coordinate transform ly:translator?
translator ly:translator-group?
translator group ly:unpure-pure-container?
unpure/pure container
[Top][Contents][Index] |