]> git.donarmstrong.com Git - lilypond.git/blob - lily/music-function-scheme.cc
Merge branch 'jneeman' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond into jneeman
[lilypond.git] / lily / music-function-scheme.cc
1 #include "music-function.hh"
2
3 LY_DEFINE (ly_music_function_p, "ly:music-function?", 1, 0, 0,
4            (SCM x),
5            "Is @var{x} an @code{music-function}?")
6 {
7   return is_music_function (x) ? SCM_BOOL_T : SCM_BOOL_F;
8 }
9                  
10 LY_DEFINE (ly_music_function_extract, "ly:music-function-extract", 1, 0, 0,
11            (SCM x),
12            "Return the Scheme function inside @var{x}")
13 {
14   SCM_ASSERT_TYPE(is_music_function (x), x, SCM_ARG1, __FUNCTION__,
15                   "music function");
16   
17   return SCM_CELL_OBJECT_1(x);
18 }
19
20 LY_DEFINE (ly_make_music_function, "ly:make-music-function", 2, 0, 0,
21            (SCM signature, SCM func),
22            "Make a function to process music, to be used for the "
23            "parser. @code{func} is the function, and @code{signature} describes "
24            "Its arguments. @code{signature} is a list containing either "
25            "@code{ly:music?} predicates or other type predicates.")
26 {
27   SCM_ASSERT_TYPE(ly_is_procedure (func), func, SCM_ARG1, __FUNCTION__, "function");
28   return  make_music_function (signature, func);
29 }
30