1 #include "music-function.hh"
3 LY_DEFINE (ly_music_function_p
, "ly:music-function?", 1, 0, 0,
5 "Is @var{x} an @code{music-function}?")
7 return is_music_function (x
) ? SCM_BOOL_T
: SCM_BOOL_F
;
10 LY_DEFINE (ly_music_function_extract
, "ly:music-function-extract", 1, 0, 0,
12 "Return the Scheme function inside @var{x}")
14 LY_ASSERT_TYPE (is_music_function
, x
, 1);
16 return SCM_CELL_OBJECT_1(x
);
19 LY_DEFINE (ly_make_music_function
, "ly:make-music-function", 2, 0, 0,
20 (SCM signature
, SCM func
),
21 "Make a function to process music, to be used for the "
22 "parser. @code{func} is the function, and @code{signature} describes "
23 "Its arguments. @code{signature} is a list containing either "
24 "@code{ly:music?} predicates or other type predicates.")
26 LY_ASSERT_TYPE (ly_is_procedure
, func
, 1);
27 return make_music_function (signature
, func
);