2004-04-12 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/include/lily-guile.hh: is_x -> ly_c_X_p naming.
+
* lily/lexer.ll: change is_string -> ly_c_string_p
* input/mutopia/J.S.Bach/wtk1-fugue2.ly (bassdux): use \book.
int number = 0;
*different = false;
- if (ly_c_pair_p (accidentals) && !is_symbol (ly_car (accidentals)))
+ if (ly_c_pair_p (accidentals) && !ly_c_symbol_p (ly_car (accidentals)))
warning (_f ("Accidental typesetting list must begin with context-name: %s",
ly_scm2string (ly_car (accidentals)).to_str0 ()));
SCM localsig = origin->get_property ("localKeySignature");
bool same_octave_b =
- is_eq (ly_symbol2scm ("same-octave"), type);
+ ly_c_eq_p (ly_symbol2scm ("same-octave"), type);
bool any_octave_b =
- is_eq (ly_symbol2scm ("any-octave"), type);
+ ly_c_eq_p (ly_symbol2scm ("any-octave"), type);
if (same_octave_b || any_octave_b)
{
/*
if symbol then it is a context name. Scan parent contexts to find it.
*/
- else if (is_symbol (rule))
+ else if (ly_c_symbol_p (rule))
{
Context * dad = origin;
while (dad && !dad->is_alias (rule))
&& Rhythmic_head::has_interface (info.grob_))
{
if (to_boolean ( get_property ("harmonicAccidentals"))
- || !is_equal (info.grob_->get_property ("style"),
+ || !ly_c_equal_p (info.grob_->get_property ("style"),
ly_symbol2scm ("harmonic")))
{
if (to_boolean (a->get_property ("cautionary")))
{
SCM cstyle = a->get_property ("cautionary-style");
- parens = is_equal (cstyle, ly_symbol2scm ("parentheses"));
+ parens = ly_c_equal_p (cstyle, ly_symbol2scm ("parentheses"));
}
SCM accs = a->get_property ("accidentals");
SCM scm_style = a->get_property ("style");
- if (!is_symbol (scm_style)
+ if (!ly_c_symbol_p (scm_style)
&& !parens
&& scm_ilength (accs) == 1)
{
if (caut)
{
SCM cstyle = me->get_property ("cautionary-style");
- parens = is_equal (cstyle, ly_symbol2scm ("parentheses"));
- smaller = is_equal (cstyle, ly_symbol2scm ("smaller"));
+ parens = ly_c_equal_p (cstyle, ly_symbol2scm ("parentheses"));
+ smaller = ly_c_equal_p (cstyle, ly_symbol2scm ("smaller"));
}
SCM scm_style = me->get_property ("style");
String style;
- if (is_symbol (scm_style))
+ if (ly_c_symbol_p (scm_style))
{
style = ly_symbol2string (scm_style);
}
SCM scm_note_head_style = me->get_property ("note-head-style");
String note_head_style;
- if (is_symbol (scm_note_head_style))
+ if (ly_c_symbol_p (scm_note_head_style))
{
String note_head_style =
ly_symbol2string (scm_note_head_style);
SCM key_signature = me->get_property ("key-signature");
SCM scm_accidentals_style = me->get_property ("accidentals-style");
String accidentals_style;
- if (is_symbol (scm_accidentals_style))
+ if (ly_c_symbol_p (scm_accidentals_style))
{
accidentals_style =
ly_symbol2string (scm_accidentals_style);
SCM cb = me->get_property ("balloon-original-callback");
SCM scm_mol = SCM_EOL;
- if (is_procedure (cb))
+ if (ly_c_procedure_p (cb))
{
scm_mol = scm_call_1 (cb, smob);
}
SCM s = me->get_property ("glyph");
SCM barsiz_proc = me->get_property ("bar-size-procedure");
- if (ly_c_string_p (s) && is_procedure (barsiz_proc))
+ if (ly_c_string_p (s) && ly_c_procedure_p (barsiz_proc))
{
String str =ly_scm2string (s);
SCM siz = scm_call_1 (barsiz_proc, me->self_scm ());
// leave y_extent for spanbar?
}
- if (! is_equal (g, orig))
+ if (! ly_c_equal_p (g, orig))
me->set_property ("glyph", g);
return SCM_UNSPECIFIED;
{
SCM bn = get_property ("currentBarNumber");
SCM proc = get_property ("barNumberVisibility");
- if (is_number (bn) && is_procedure (proc)
+ if (is_number (bn) && ly_c_procedure_p (proc)
&& to_boolean (scm_call_1(proc, bn)))
{
create_items ();
{
SCM func = me->get_property ("space-function");
- if (is_procedure (func))
+ if (ly_c_procedure_p (func))
{
SCM s = scm_call_2 (func, me->self_scm (), scm_int2num (get_beam_count (me)));
return ly_scm2double (s);
Beam::is_knee (Grob* me)
{
SCM k = me->get_property ("knee");
- if (is_boolean (k))
+ if (ly_c_boolean_p (k))
return ly_scm2bool (k);
bool knee = false;
return ;
SCM align_name = item->get_property ("break-align-symbol");
- if (!is_symbol (align_name))
+ if (!ly_c_symbol_p (align_name))
return ;
if (!align_)
Item *me = dynamic_cast<Item*> (grob);
SCM elts = me->get_property ("elements");
SCM order_vec = me->get_property ("break-align-orders");
- if (!is_vector (order_vec)
+ if (!ly_c_vector_p (order_vec)
|| ly_vector_length (order_vec) < 3)
return Pointer_group_interface__extract_grobs (me, (Grob*)0,
"elements");
reason.
*/
for (SCM s = r ? r->get_property ("elements") : SCM_EOL;
- !is_symbol (rsym) && ly_c_pair_p (s); s = ly_cdr (s))
+ !ly_c_symbol_p (rsym) && ly_c_pair_p (s); s = ly_cdr (s))
{
Grob * elt =unsmob_grob (ly_car (s));
edge_idx = next_idx;
SCM entry = SCM_EOL;
- if (is_symbol (rsym))
+ if (ly_c_symbol_p (rsym))
entry = scm_assq (rsym, alist);
bool entry_found = ly_c_pair_p (entry);
if (!entry_found)
{
String sym_string;
- if (is_symbol (rsym))
+ if (ly_c_symbol_p (rsym))
sym_string = ly_symbol2string (rsym);
String orig_string ;
if (unsmob_grob (src))
return substitute_grob (unsmob_grob (src));
- else if (is_vector (src))
+ else if (ly_c_vector_p (src))
{
int len = SCM_VECTOR_LENGTH (src);
SCM nv = scm_c_make_vector (len, SCM_UNDEFINED);
announce_grob (chord_name_, notes_[0]->self_scm ());
SCM s = get_property ("chordChanges");
if (to_boolean (s) && ly_c_pair_p (last_chord_)
- && is_equal (chord_as_scm, last_chord_))
+ && ly_c_equal_p (chord_as_scm, last_chord_))
chord_name_->set_property ("begin-of-line-visible", SCM_BOOL_T);
last_chord_ = chord_as_scm;
SCM shape_scm = me->get_property ("style");
String shape;
- if (is_symbol (shape_scm))
+ if (ly_c_symbol_p (shape_scm))
{
shape = ly_symbol2string (shape_scm);
}
Link_array<Context_def>
Context_def::path_to_acceptable_context (SCM type_sym, Music_output_def* odef) const
{
- assert (is_symbol (type_sym));
+ assert (ly_c_symbol_p (type_sym));
SCM accepted = get_accepted (SCM_EOL);
/*
don't check aliases, because \context Staff should not create RhythmicStaff.
*/
- if (is_equal (accepteds[i]->get_context_name (), type_sym))
+ if (ly_c_equal_p (accepteds[i]->get_context_name (), type_sym))
{
best_result.push (accepteds[i]);
return best_result;
l = scm_cons (scm_cons (ly_symbol2scm ("property-ops"), property_ops_), l);
l = scm_cons (scm_cons (ly_symbol2scm ("context-name"), context_name_), l);
- if (is_symbol (translator_group_type_))
+ if (ly_c_symbol_p (translator_group_type_))
l = scm_cons (scm_cons (ly_symbol2scm ("group-type"), translator_group_type_), l);
return l;
{
Context *tg = unsmob_context (context);
SCM_ASSERT_TYPE (tg, context, SCM_ARG1, __FUNCTION__, "context");
- SCM_ASSERT_TYPE (is_symbol (grob), grob, SCM_ARG2, __FUNCTION__, "symbol");
- SCM_ASSERT_TYPE (is_symbol (eltprop), eltprop, SCM_ARG3, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (ly_c_symbol_p (grob), grob, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (ly_c_symbol_p (eltprop), eltprop, SCM_ARG3, __FUNCTION__, "symbol");
execute_pushpop_property (tg, grob, eltprop, val);
Context *t = unsmob_context (c);
Context * tr= (t);
SCM_ASSERT_TYPE (tr, c, SCM_ARG1, __FUNCTION__, "Translator group");
- SCM_ASSERT_TYPE (is_symbol (name), name, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (ly_c_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
return tr->internal_get_property (name);
}
{
Context *tr = unsmob_context (context);
SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
- SCM_ASSERT_TYPE (is_symbol (name), name, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (ly_c_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
tr->internal_set_property (name, val);
{
Context *tr = unsmob_context (context);
SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
- SCM_ASSERT_TYPE (is_symbol (name), name, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (ly_c_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
tr = tr->where_defined (name);
if (tr)
{
Context *tr = unsmob_context (context);
SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
- SCM_ASSERT_TYPE (is_symbol (name), name, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (ly_c_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
tr->unset_property (name);
return SCM_UNSPECIFIED;
{
Context *tr = unsmob_context (context);
SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "context");
- SCM_ASSERT_TYPE (is_symbol (name), name, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (ly_c_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
while (tr)
{
bool
Context::is_bottom_context () const
{
- return !is_symbol (default_child_context_name ());
+ return !ly_c_symbol_p (default_child_context_name ());
}
Context*
SCM scm_style = me->get_property ("style");
String style;
- if (is_symbol (scm_style))
+ if (ly_c_symbol_p (scm_style))
{
style = ly_symbol2string (scm_style);
}
if (scm_integer_p (pos) == SCM_BOOL_T)
note->set_property ("staff-position", pos);
- if (is_symbol (style))
+ if (ly_c_symbol_p (style))
note->set_property ("style", style);
if (ly_c_string_p (script))
SCM sym = n->get_property ("drum-type");
SCM defn = SCM_EOL;
- if (is_symbol (sym)
+ if (ly_c_symbol_p (sym)
&& (scm_hash_table_p (tab) == SCM_BOOL_T))
defn = scm_hashq_ref (tab, sym, SCM_EOL);
start_type = "crescendo";
SCM s = get_property ((start_type + "Spanner").to_str0 ());
- if (!is_symbol (s) || s == ly_symbol2scm ("hairpin"))
+ if (!ly_c_symbol_p (s) || s == ly_symbol2scm ("hairpin"))
{
cresc_ = make_spanner ("Hairpin");
cresc_->set_property ("grow-direction",
SCM proc = get_property ("dynamicAbsoluteVolumeFunction");
SCM svolume = SCM_EOL;
- if (is_procedure (proc))
+ if (ly_c_procedure_p (proc))
{
// urg
svolume = scm_call_1 (proc, script_req_->get_property ("text"));
SCM eq = get_property ("instrumentEqualizer");
- if (is_procedure (eq))
+ if (ly_c_procedure_p (eq))
{
s = scm_call_1 (eq, s);
}
SCM l = scm_assoc (key, b);
if (l == SCM_BOOL_F
- || !is_equal ( ly_cdr (l), val))
+ || !ly_c_equal_p ( ly_cdr (l), val))
return false;
}
else if (figures_.size ())
{
SCM proc = get_property ("bassFigureFormatFunction");
- if (is_procedure (proc))
+ if (ly_c_procedure_p (proc))
{
SCM l = SCM_EOL;
SCM * t = &l;
if (!strlen (doc))
return ;
- if (!is_vector (doc_hash_table ))
+ if (!ly_c_vector_p (doc_hash_table ))
doc_hash_table = scm_make_vector (scm_int2num (59), SCM_EOL);
String s = String (" - ") + "LilyPond procedure: " + fname + " " + varlist
LY_DEFINE (ly_add_interface, "ly:add-interface", 3,0,0, (SCM a, SCM b, SCM c),
"Add an interface description.")
{
- SCM_ASSERT_TYPE (is_symbol (a), a, SCM_ARG1, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (ly_c_symbol_p (a), a, SCM_ARG1, __FUNCTION__, "symbol");
SCM_ASSERT_TYPE (ly_c_string_p (b), b, SCM_ARG2, __FUNCTION__, "string");
- SCM_ASSERT_TYPE (is_list (c), c, SCM_ARG3, __FUNCTION__, "list of syms");
- if (!is_vector (all_ifaces))
+ SCM_ASSERT_TYPE (ly_c_list_p (c), c, SCM_ARG3, __FUNCTION__, "list of syms");
+ if (!ly_c_vector_p (all_ifaces))
all_ifaces = scm_make_vector (scm_int2num (40), SCM_EOL);
SCM entry = scm_list_n (a, b, c, SCM_UNDEFINED);
{
Grob * sc = unsmob_grob (grob);
SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
- SCM_ASSERT_TYPE (is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (ly_c_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
if (!type_check_assignment (sym, val, ly_symbol2scm ("backend-type?")))
error ("typecheck failed");
{
Grob *sc = unsmob_grob (grob);
SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
- SCM_ASSERT_TYPE (is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (ly_c_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
return sc->internal_get_property (sym);
}
if (is_number_pair (xt))
cb = xt;
else if (cb != SCM_BOOL_F
- && !is_procedure (cb) && !ly_c_pair_p (cb)
- && is_procedure (get_property ("print-function")))
+ && !ly_c_procedure_p (cb) && !ly_c_pair_p (cb)
+ && ly_c_procedure_p (get_property ("print-function")))
cb = stencil_extent_proc;
dim_cache_[a].dimension_ = cb;
SCM proc = internal_get_property (funcname);
- if (is_procedure (proc))
+ if (ly_c_procedure_p (proc))
scm_call_1 (proc, this->self_scm ());
status_= final;
SCM proc = get_property ("print-function");
SCM mol = SCM_EOL;
- if (is_procedure (proc))
+ if (ly_c_procedure_p (proc))
mol = scm_apply_0 (proc, scm_list_n (this->self_scm (), SCM_UNDEFINED));
Stencil *m = unsmob_stencil (mol);
Grob::is_empty (Axis a)const
{
return ! (ly_c_pair_p (dim_cache_[a].dimension_) ||
- is_procedure (dim_cache_[a].dimension_));
+ ly_c_procedure_p (dim_cache_[a].dimension_));
}
Interval
Interval ext ;
if (ly_c_pair_p (d->dimension_))
;
- else if (is_procedure (d->dimension_))
+ else if (ly_c_procedure_p (d->dimension_))
{
/*
FIXME: add doco on types, and should typecheck maybe?
SCM meta = get_property ("meta");
SCM nm = scm_assoc (ly_symbol2scm ("name"), meta);
nm = (ly_c_pair_p (nm)) ? ly_cdr (nm) : SCM_EOL;
- return is_symbol (nm) ? ly_symbol2string (nm) : classname (this);
+ return ly_c_symbol_p (nm) ? ly_symbol2string (nm) : classname (this);
}
void
return scm_acons(key, val, scm_assoc_remove_x (alist, key));
}
inline bool ly_c_pair_p (SCM x) { return SCM_NFALSEP (scm_pair_p (x)); }
-inline bool is_symbol (SCM x) { return SCM_SYMBOLP (x); }
-inline bool is_boolean (SCM x) { return SCM_BOOLP (x); }
-inline bool is_char (SCM x) { return SCM_CHARP (x); }
+inline bool ly_c_symbol_pi (SCM x) { return SCM_SYMBOLP (x); }
+inline bool ly_c_boolean_p (SCM x) { return SCM_BOOLP (x); }
+inline bool ly_c_char_p (SCM x) { return SCM_CHARP (x); }
inline bool is_number (SCM x) { return SCM_NUMBERP (x); }
inline bool ly_c_string_p (SCM x) { return SCM_STRINGP (x); }
-inline bool is_vector (SCM x) { return SCM_VECTORP (x); }
-inline bool is_list (SCM x) { return SCM_NFALSEP (scm_list_p (x)); }
-inline bool is_procedure (SCM x) { return SCM_NFALSEP (scm_procedure_p (x)); }
-inline bool is_eq (SCM x, SCM y) { return SCM_EQ_P (x, y); }
-inline bool is_equal (SCM x, SCM y) {
+inline bool ly_c_vector_p (SCM x) { return SCM_VECTORP (x); }
+inline bool ly_c_list_p (SCM x) { return SCM_NFALSEP (scm_list_p (x)); }
+inline bool ly_c_procedure_p (SCM x) { return SCM_NFALSEP (scm_procedure_p (x)); }
+inline bool ly_c_eq_p (SCM x, SCM y) { return SCM_EQ_P (x, y); }
+inline bool ly_c_equal_p (SCM x, SCM y) {
return SCM_NFALSEP (scm_equal_p (x, y));
}
more complicated things.
*/
SCM vis = get_property ("break-visibility");
- if (is_procedure (vis))
+ if (ly_c_procedure_p (vis))
{
SCM args = scm_list_n (scm_int2num (break_status_dir ()), SCM_UNDEFINED);
SCM result = scm_apply_0 (vis, args);
if (!def)
{
SCM vis = get_property ("explicitKeySignatureVisibility");
- if (is_procedure (vis))
+ if (ly_c_procedure_p (vis))
item_->set_property ("break-visibility",vis);
}
}
SCM scm_style = me->get_property ("style");
String style;
- if (is_symbol (scm_style))
+ if (ly_c_symbol_p (scm_style))
{
style = ly_symbol2string (scm_style);
}
String str (YYText () + 1);
SCM s = lookup_markup_command (str);
- if (ly_c_pair_p (s) && is_symbol (ly_cdr (s)) ) {
+ if (ly_c_pair_p (s) && ly_c_symbol_p (ly_cdr (s)) ) {
yylval.scm = ly_car(s);
SCM tag = ly_cdr(s);
if (tag == ly_symbol2scm("markup0"))
yylval.scm = ly_cdr (handle);
if (unsmob_pitch (yylval.scm))
return (YYSTATE == notes) ? NOTENAME_PITCH : TONICNAME_PITCH;
- else if (is_symbol (yylval.scm))
+ else if (ly_c_symbol_p (yylval.scm))
return DRUM_PITCH;
}
else if ((handle = scm_hashq_get_handle (chordmodifier_tab_, sym))!= SCM_BOOL_F)
String
ly_symbol2string (SCM s)
{
- assert (is_symbol (s));
+ assert (ly_c_symbol_p (s));
return String ((Byte*)SCM_STRING_CHARS (s), (int) SCM_STRING_LENGTH (s));
}
bool
to_boolean (SCM s)
{
- return is_boolean (s) && ly_scm2bool (s);
+ return ly_c_boolean_p (s) && ly_scm2bool (s);
}
/* Appendable list L: the cdr contains the list, the car the last cons
{
if (ly_c_pair_p (src))
return scm_cons (ly_deep_copy (ly_car (src)), ly_deep_copy (ly_cdr (src)));
- else if (is_vector (src))
+ else if (ly_c_vector_p (src))
{
int len = SCM_VECTOR_LENGTH (src);
SCM nv = scm_c_make_vector (len, SCM_UNDEFINED);
if (val == SCM_EOL || val == SCM_BOOL_F)
return ok;
- if (!is_symbol (sym))
+ if (!ly_c_symbol_p (sym))
#if 0
return false;
#else
SCM type = scm_object_property (sym, type_symbol);
- if (type != SCM_EOL && !is_procedure (type))
+ if (type != SCM_EOL && !ly_c_procedure_p (type))
{
warning (_f ("Can't find property type-check for `%s' (%s).",
ly_symbol2string (sym).to_str0 (),
else
{
if (val != SCM_EOL
- && is_procedure (type)
+ && ly_c_procedure_p (type)
&& scm_call_1 (type, val) == SCM_BOOL_F)
{
SCM errport = scm_current_error_port ();
for (SCM i = list; ly_c_pair_p (i); i = ly_cdr (i))
{
if (!ly_c_pair_p (ly_cdr (i))
- || !is_equal (ly_car (i), ly_cadr (i)))
+ || !ly_c_equal_p (ly_car (i), ly_cadr (i)))
unique = scm_cons (ly_car (i), unique);
}
return scm_reverse_x (unique, SCM_EOL);
{
SCM i = ly_car (after);
after = ly_cdr (after);
- if (is_equal (i, s))
+ if (ly_c_equal_p (i, s))
break;
before = scm_cons (i, before);
}
{
Offset dz = to -from ;
SCM type = me->get_property ("style");
- if (is_symbol (type)
+ if (ly_c_symbol_p (type)
&& (type == ly_symbol2scm ("line")
|| type == ly_symbol2scm ("dashed-line")
|| type == ly_symbol2scm ("dotted-line")
? zigzag_stencil (me, from, to)
: Line_interface::line (me, from, to);
}
- else if (is_symbol (type)
+ else if (ly_c_symbol_p (type)
&& type == ly_symbol2scm ("trill"))
{
SCM alist_chain = Font_interface::text_font_alist_chain (me);
SCM m = mark_ev_->get_property ("label");
SCM proc = get_property ("markFormatter");
if (!Text_item::markup_p (m) &&
- is_procedure (proc))
+ ly_c_procedure_p (proc))
{
if (!is_number (m))
m = get_property ("rehearsalMark");
SCM ctor = m->get_property ("iterator-ctor") ;
SCM iter = SCM_EOL;
- if (is_procedure (ctor))
+ if (ly_c_procedure_p (ctor))
{
iter = scm_call_0 (ctor);
p = unsmob_iterator (iter);
{
Music_output_def *op = unsmob_music_output_def (pap);
SCM_ASSERT_TYPE (op, pap, SCM_ARG1, __FUNCTION__, "Paper");
- SCM_ASSERT_TYPE (is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (ly_c_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
SCM var = ly_module_lookup (op->scope_, sym);
if (SCM_VARIABLEP (var))
Music::name () const
{
SCM nm = get_property ("name");
- if (is_symbol (nm))
+ if (ly_c_symbol_p (nm))
{
return ly_symbol2string (nm);
}
SCM lst = get_property ("length");
if (unsmob_moment (lst))
return *unsmob_moment (lst);
- else if (is_procedure (lst))
+ else if (ly_c_procedure_p (lst))
{
SCM res = scm_call_1 (lst, self_scm ());
return *unsmob_moment (res);
Music::start_mom () const
{
SCM lst = get_property ("start-moment-function");
- if (is_procedure (lst))
+ if (ly_c_procedure_p (lst))
{
SCM res = scm_call_1 (lst, self_scm ());
return *unsmob_moment (res);
Music* m = unsmob_music (s);
SCM nm = m->get_property ("name");
- if (is_symbol (nm) || ly_c_string_p (nm))
+ if (ly_c_symbol_p (nm) || ly_c_string_p (nm))
scm_display (nm, p);
else
scm_puts (classname (m),p);
{
Music * sc = unsmob_music (mus);
SCM_ASSERT_TYPE (sc, mus, SCM_ARG1, __FUNCTION__, "music");
- SCM_ASSERT_TYPE (is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (ly_c_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
return sc->internal_get_property (sym);
}
{
Music * sc = unsmob_music (mus);
SCM_ASSERT_TYPE (sc, mus, SCM_ARG1, __FUNCTION__, "music");
- SCM_ASSERT_TYPE (is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (ly_c_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
bool ok = type_check_assignment (sym, val, ly_symbol2scm ("music-type?"));
if (ok)
val = scm_c_eval_string ("line-location");
scm_module_define (global_lily_module, ly_symbol2scm ("point-and-click"), val);
- store_locations_global_b = is_procedure (val);
+ store_locations_global_b = ly_c_procedure_p (val);
return SCM_UNSPECIFIED;
}
/* Do not merge notes typeset in different style. */
- if ( !is_equal (nu->get_property ("style"),
+ if ( !ly_c_equal_p (nu->get_property ("style"),
nd->get_property ("style") ) )
merge_possible = false;
internal_print (Grob *me, bool with_ledgers)
{
SCM style = me->get_property ("style");
- if (!is_symbol (style))
+ if (!ly_c_symbol_p (style))
{
return Stencil ();
}
SCM idx = scm_int2num (pit->get_notename ());
SCM names = me->get_property ("note-names");
SCM charstr = SCM_EOL;
- if (is_vector (names))
+ if (ly_c_vector_p (names))
charstr = scm_vector_ref (names, idx);
else
{
if (brewer == Note_head::print_proc)
{
SCM style = me->get_property ("style");
- if (!is_symbol (style))
+ if (!ly_c_symbol_p (style))
{
return 0.0;
}
Fallback
*/
SCM v = me->get_property ("stem-attachment-function");
- if (!is_procedure (v))
+ if (!ly_c_procedure_p (v))
return 0.0;
SCM result = scm_call_2 (v, me->self_scm (), scm_int2num (a));
- if (is_procedure (pred))
+ if (ly_c_procedure_p (pred))
{
/*
should typecheck pred.
{
SCM scale_var = ly_module_lookup (scope_, ly_symbol2scm ("outputscale"));
- if (!is_symbol (input_enc_name))
+ if (!ly_c_symbol_p (input_enc_name))
{
SCM var = ly_module_lookup (scope_, ly_symbol2scm ("inputencoding"));
input_enc_name = scm_variable_ref (var);
tag_music (Music *m, SCM tag, Input ip)
{
SCM tags = m->get_property ("tags");
- if (is_symbol (tag))
+ if (ly_c_symbol_p (tag))
tags = scm_cons (tag, tags);
- else if (is_list (tag))
+ else if (ly_c_list_p (tag))
tags = ly_append2 (tag, tags);
else
ip.warning (_ ("Tag must be symbol or list of symbols."));
make_simple_markup (SCM encoding, SCM a)
{
SCM simple = ly_scheme_function ("simple-markup");
- if (is_symbol (encoding))
+ if (ly_c_symbol_p (encoding))
return scm_list_3 (ly_scheme_function ("encoded-simple-markup"),
encoding, a);
return scm_list_2 (simple, a);
bool
ly_input_procedure_p (SCM x)
{
- return is_procedure (x)
- || (ly_c_pair_p (x) && is_procedure (ly_car (x)));
+ return ly_c_procedure_p (x)
+ || (ly_c_pair_p (x) && ly_c_procedure_p (ly_car (x)));
}
Music*
r->set_property ("repeat-count", scm_int2num (times >? 1));
r-> set_property ("elements",alts);
- if (is_equal ($2, scm_makfrom0str ("tremolo"))) {
+ if (ly_c_equal_p ($2, scm_makfrom0str ("tremolo"))) {
/*
TODO: move this code to Scheme.
*/
evs = scm_hash_ref (tab, key, SCM_BOOL_F);
}
Music *quote = 0;
- if (is_vector (evs))
+ if (ly_c_vector_p (evs))
{
quote = MY_MAKE_MUSIC ("QuoteMusic");
quote->set_property ("duration", $3);
bool itc = internal_type_checking_global_b;
/* UGH.
*/
- bool autobeam = is_equal (symbol, ly_symbol2scm ("autoBeamSettings"));
+ bool autobeam = ly_c_equal_p (symbol, ly_symbol2scm ("autoBeamSettings"));
if (autobeam)
internal_type_checking_global_b = false;
m->set_property ("grob-property", grob_sym);
scm_gc_unprotect_object (m->self_scm ());
csm->set_property ("context-type",
- is_symbol (type) ? type : scm_string_to_symbol (type));
+ ly_c_symbol_p (type) ? type : scm_string_to_symbol (type));
csm->set_property ("property-operations", ops);
if (ly_c_string_p (id))
solo1 ();
else if (tag == ly_symbol2scm ("solo2"))
solo2 ();
- else if (is_symbol (tag))
+ else if (ly_c_symbol_p (tag))
{
String s = "Unknown split directive: "
- + (is_symbol (tag) ? ly_symbol2string (tag) : String ("not a symbol"));
+ + (ly_c_symbol_p (tag) ? ly_symbol2string (tag) : String ("not a symbol"));
programming_error (s);
}
}
for (Pedal_info*p = info_list_; p->name_; p ++)
{
String nm = p->name_ + String ("Event");
- if (is_equal (m->get_property ("name") ,
+ if (ly_c_equal_p (m->get_property ("name") ,
scm_str2symbol(nm.to_str0())))
{
Direction d = to_dir (m->get_property ("span-direction"));
for (Pedal_info*p = info_alist_; p->name_; p ++)
{
String nm = p->name_ + String ("Event");
- if (is_equal (r->get_property ("name") ,
+ if (ly_c_equal_p (r->get_property ("name") ,
scm_str2symbol (nm.to_str0())))
{
Direction d = to_dir (r->get_property ("span-direction"));
Property_iterator::process (Moment m)
{
SCM sym = get_music ()->get_property ("symbol");
- if (is_symbol (sym))
+ if (ly_c_symbol_p (sym))
{
SCM val = get_music ()->get_property ("value");
bool ok= true;
start_moment_ = now;
event_vector_ = get_music ()->get_property ("quoted-events");
- if (is_vector (event_vector_))
+ if (ly_c_vector_p (event_vector_))
{
event_idx_ = binsearch_scm_vector (event_vector_, now.smobbed_copy (), &moment_less);
end_idx_ = binsearch_scm_vector (event_vector_, stop.smobbed_copy (), &moment_less);
Engraver_group_engraver::finalize ();
SCM proc = get_property ("recordEventSequence");
- if (is_procedure (proc))
+ if (ly_c_procedure_p (proc))
scm_call_2 (proc, get_parent_context ()->self_scm (), ly_cdr (accumulator_));
accumulator_ = SCM_EOL;
*/
SCM wb = get_property ("whichBar");
SCM db = get_property ("defaultBarType");
- if (!ly_c_string_p (wb) || is_equal (db, wb))
+ if (!ly_c_string_p (wb) || ly_c_equal_p (db, wb))
{
if (s != "" || (volta_found && !ly_c_string_p (wb)))
{
String style;
SCM style_scm = me->get_property ("style");
- if (is_symbol (style_scm))
+ if (ly_c_symbol_p (style_scm))
style = ly_scm2string (scm_symbol_to_string (style_scm));
Font_metric *fm = Font_interface::get_default_font (me);
coding_vector_ = scm_call_1 (ly_scheme_function ("get-coding-vector"),
scm_makfrom0str (coding_scheme_.to_str0 ()));
- if (!is_vector (coding_vector_))
+ if (!ly_c_vector_p (coding_vector_))
{
programming_error ("get-coding-vector should return vector");
coding_vector_ = scm_c_make_vector (256, ly_symbol2scm (".notdef"));
/*
UGOHR.
*/
- if (is_symbol (coding))
+ if (ly_c_symbol_p (coding))
coding = scm_symbol_to_string (coding);
String scheme = ly_scm2string (coding);
Box char_box;
- if (!is_symbol (sym))
+ if (!ly_c_symbol_p (sym))
continue;
char const * chars = SCM_SYMBOL_CHARS(sym);
void
Scheme_hash_table::set (SCM k, SCM v)
{
- assert (is_symbol (k));
+ assert (ly_c_symbol_p (k));
SCM handle = scm_hashq_create_handle_x (hash_tab_, k, SCM_UNDEFINED);
if (ly_cdr (handle) == SCM_UNDEFINED)
{
This is necessary for part-combining.
*/
for (int j = 0; j < scripts_.size (); j++)
- if (is_equal (scripts_[j]. event_->get_property ("articulation-type"),
+ if (ly_c_equal_p (scripts_[j]. event_->get_property ("articulation-type"),
r->get_property ("articulation-type")
))
return true;
{
Grob * break_item = unsmob_grob (ly_car (s));
- if (!is_symbol (break_item->get_property ("break-align-symbol")))
+ if (!ly_c_symbol_p (break_item->get_property ("break-align-symbol")))
continue;
Interval ext = break_item->extent (col, X_AXIS);
do
{
- if (!is_symbol (index_get_cell (att, dir)))
+ if (!ly_c_symbol_p (index_get_cell (att, dir)))
{
SCM p = me->get_property ("extremity-function");
SCM res = ly_symbol2scm ("head");
- if (is_procedure (p))
+ if (ly_c_procedure_p (p))
res = scm_call_2 (p, me->self_scm (), scm_int2num (dir));
- if (is_symbol (res))
+ if (ly_c_symbol_p (res))
index_set_cell (att, dir, res);
}
}
Grob **common)
{
SCM s = me->get_property ("attachment");
- if (!ly_c_pair_p (s) || !is_symbol (index_get_cell (s, dir)))
+ if (!ly_c_pair_p (s) || !ly_c_symbol_p (index_get_cell (s, dir)))
{
s = set_extremities (me);
}
if (!get_grob_direction (me)
- || ! is_symbol (index_get_cell (attach, LEFT))
- || ! is_symbol (index_get_cell (attach, RIGHT)))
+ || ! ly_c_symbol_p (index_get_cell (attach, LEFT))
+ || ! ly_c_symbol_p (index_get_cell (attach, RIGHT)))
set_extremities (me);
if (!ly_c_pair_p (me->get_property ("control-points")))
SCM vissym =ly_symbol2scm ("break-visibility");
SCM vis = bars_[0]->internal_get_property (vissym);
- if (is_equal (spanbar_->internal_get_property (vissym), vis))
+ if (ly_c_equal_p (spanbar_->internal_get_property (vissym), vis))
spanbar_->internal_set_property (vissym, vis);
typeset_grob (spanbar_);
String flag_style;
SCM flag_style_scm = me->get_property ("flag-style");
- if (is_symbol (flag_style_scm))
+ if (ly_c_symbol_p (flag_style_scm))
{
flag_style = ly_symbol2string (flag_style_scm);
}
/*
UGH UGH
*/
- if (ly_c_string_p (gl) && is_equal (gl, scm_makfrom0str ("brace"))
- && ly_c_string_p (my_gl) && is_equal (my_gl, scm_makfrom0str ("bracket")))
+ if (ly_c_string_p (gl) && ly_c_equal_p (gl, scm_makfrom0str ("brace"))
+ && ly_c_string_p (my_gl) && ly_c_equal_p (my_gl, scm_makfrom0str ("bracket")))
inf.grob_->translate_axis (-0.8, X_AXIS); // ugh
- else if (ly_c_string_p (gl) && is_equal (gl, scm_makfrom0str ("bracket"))
- && ly_c_string_p (my_gl) && is_equal (my_gl, scm_makfrom0str ("bracket")))
+ else if (ly_c_string_p (gl) && ly_c_equal_p (gl, scm_makfrom0str ("bracket"))
+ && ly_c_string_p (my_gl) && ly_c_equal_p (my_gl, scm_makfrom0str ("bracket")))
{
inf.grob_->translate_axis ( -0.8, X_AXIS); // ugh
inf.grob_->set_property ("arch-height",
{
Grob * me = unsmob_grob (smob);
SCM gl = me->get_property ("glyph");
- if (is_equal (gl,scm_makfrom0str ("bar-line")))
+ if (ly_c_equal_p (gl,scm_makfrom0str ("bar-line")))
{
int count = 0;
{
Grob * e = unsmob_grob (ly_car (s));
SCM proc = e->get_property ("spacing-procedure");
- if (is_procedure (proc))
+ if (ly_c_procedure_p (proc))
scm_call_1 (proc, e->self_scm ());
}
}
SCM_ASSERT_TYPE(pap, paper, SCM_ARG1, __FUNCTION__, "Paper definition");
SCM_ASSERT_TYPE(ly_c_string_p (markup), markup, SCM_ARG3, __FUNCTION__, "string");
SCM_ASSERT_TYPE(encoding == SCM_EOL
- || is_symbol (encoding), encoding, SCM_ARG2, __FUNCTION__, "symbol");
+ || ly_c_symbol_p (encoding), encoding, SCM_ARG2, __FUNCTION__, "symbol");
String str = ly_scm2string (markup);
Font_metric *fm = select_encoded_font (pap, props, encoding);
SCM sym = ly_symbol2scm (s.to_str0 ());
SCM idx = scm_hash_ref (encoding_table_, sym, SCM_BOOL_F);
- if (is_char (idx))
+ if (ly_c_char_p (idx))
{
return (unsigned char) ly_scm2char (idx);
}
maybe should check positions too.
*/
if (right_mus && left_mus
- && is_equal (right_mus->get_property ("pitch"),
+ && ly_c_equal_p (right_mus->get_property ("pitch"),
left_mus->get_property ("pitch")))
{
Grob * p = make_spanner ("Tie");
Music * left_mus = heads_to_tie_[i].event_;
if (right_mus && left_mus
- && is_equal (right_mus->get_property ("pitch"),
+ && ly_c_equal_p (right_mus->get_property ("pitch"),
left_mus->get_property ("pitch")))
{
an->tie_to (th);
Time_signature_performer::create_audio_elements ()
{
SCM fr = get_property ("timeSignatureFraction");
- if (ly_c_pair_p (fr) && !is_equal (fr, prev_fraction_))
+ if (ly_c_pair_p (fr) && !ly_c_equal_p (fr, prev_fraction_))
{
prev_fraction_ = fr;
int b = ly_scm2int (ly_car (fr));
}
Stencil m;
- if (is_symbol (st))
+ if (ly_c_symbol_p (st))
{
String style (ly_scm2string (scm_symbol_to_string (st)));
if (style[0]=='1')
execute_pushpop_property (Context * trg,
SCM prop, SCM eltprop, SCM val)
{
- if (is_symbol (prop) && is_symbol (eltprop))
+ if (ly_c_symbol_p (prop) && ly_c_symbol_p (eltprop))
{
if (val != SCM_UNDEFINED)
{
while (prev_alist != daddy)
{
- if (is_equal (ly_caar (prev_alist), eltprop))
+ if (ly_c_equal_p (ly_caar (prev_alist), eltprop))
{
prev_alist = ly_cdr (prev_alist);
break ;
SCM
updated_grob_properties (Context * tg, SCM sym)
{
- assert (is_symbol (sym));
+ assert (ly_c_symbol_p (sym));
tg = tg->where_defined (sym);
if (!tg)
Fixme: the type of this prop is sucky.
*/
SCM bracket = me->get_property ("bracket-visibility");
- if (is_boolean (bracket))
+ if (ly_c_boolean_p (bracket))
{
bracket_visibility = ly_scm2bool (bracket);
}
bracket_visibility = !par_beam;
SCM numb = me->get_property ("number-visibility");
- if (is_boolean (numb))
+ if (ly_c_boolean_p (numb))
{
number_visibility = ly_scm2bool (numb);
}
SCM proc = get_property ("tupletNumberFormatFunction");
- if (is_procedure (proc))
+ if (ly_c_procedure_p (proc))
{
SCM t = scm_apply_0 (proc, scm_list_n (time_scaled_musics_[i]->self_scm (), SCM_UNDEFINED));
glep->set_property ("text", t);