source file of the GNU LilyPond music typesetter
- (c) 1998--2006 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1998--2007 Jan Nieuwenhuizen <janneke@gnu.org>
Han-Wen Nienhuys <hanwen@xs4all.nl>
*/
/*
symbols/strings.
*/
-SCM
-ly_to_symbol (SCM scm)
-{
- return scm_string_to_symbol (ly_to_string (scm));
-}
-
-SCM
-ly_to_string (SCM scm)
-{
- return scm_call_3 (ly_lily_module_constant ("format"), SCM_BOOL_F,
-
- scm_makfrom0str ("~S"), scm);
-}
-
SCM
ly_write2scm (SCM s)
{
(int) scm_i_string_length (str));
}
+SCM
+ly_string2scm (string const &str)
+{
+ return scm_from_locale_stringn (str.c_str(),
+ str.length ());
+}
+
+
char *
ly_scm2newstr (SCM str, size_t *lenp)
{
return src;
}
-
-SCM
-ly_truncate_list (int k, SCM lst)
-{
- if (k == 0)
- lst = SCM_EOL;
- else
- {
- SCM s = lst;
- k--;
- for (; scm_is_pair (s) && k--; s = scm_cdr (s))
- ;
-
- if (scm_is_pair (s))
- scm_set_cdr_x (s, SCM_EOL);
- }
- return lst;
-}
-
-
-
-
-
string
print_scm_val (SCM val)
{
/* Be strict when being anal :) */
if (do_internal_type_checking_global)
- abort ();
+ scm_throw (ly_symbol2scm ("ly-file-failed"), scm_list_3 (ly_symbol2scm ("typecheck"),
+ sym, val));
warning (_ ("doing assignment anyway"));
}
return scm_call_1 (func, tab);
}
-int
-procedure_arity (SCM proc)
-{
- assert (ly_is_procedure (proc));
- SCM arity = scm_procedure_property (proc,
- ly_symbol2scm ("arity"));
-
- SCM fixed = scm_car (arity);
- return scm_to_int (fixed);
-}
/*
C++ interfacing.