ly_add_type_predicate ((void*) &is_direction, "direction");
ly_add_type_predicate ((void*) &is_music_function, "Music_function");
ly_add_type_predicate ((void*) &ly_is_port, "port");
+ ly_add_type_predicate ((void*) &ly_cheap_is_list, "list");
ly_add_type_predicate ((void*) &unsmob_global_context, "Global_context");
ly_add_type_predicate ((void*) &unsmob_input, "Input");
ly_add_type_predicate ((void*) &unsmob_moment, "Moment");
"Return value if KEY in ALIST, else DEFAULT-VALUE "
"(or #f if not specified).")
{
+ LY_ASSERT_TYPE(ly_cheap_is_list, alist, 2);
+
SCM handle = scm_assoc (key, alist);
if (scm_is_pair (handle))
return scm_cdr (handle);
LY_DEFINE (ly_string_substitute, "ly:string-substitute",
3, 0, 0, (SCM a, SCM b, SCM s),
- "Replace @var{a} by @var{b} in @var{s}.")
+ "Replace string @var{a} by string @var{b} in string @var{s}.")
{
LY_ASSERT_TYPE (scm_is_string, s, 1);
LY_ASSERT_TYPE (scm_is_string, b, 2);
inline bool ly_is_fraction (SCM x) { return SCM_FRACTIONP(x) || scm_is_integer (x); }
inline bool ly_is_list (SCM x) { return SCM_NFALSEP (scm_list_p (x)); }
+inline bool ly_cheap_is_list (SCM x) { return scm_is_pair (x) || x == SCM_EOL; }
inline bool ly_is_procedure (SCM x) { return SCM_NFALSEP (scm_procedure_p (x)); }
inline bool ly_is_port (SCM x) { return SCM_NFALSEP (scm_port_p (x)); }