From: fred Date: Wed, 27 Mar 2002 02:06:05 +0000 (+0000) Subject: lilypond-1.5.35 X-Git-Tag: release/1.5.59~301 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=8df6881b781308500a612b357492b3cc30fa43aa;p=lilypond.git lilypond-1.5.35 --- diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index 69eda94276..f957616d8b 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -148,6 +148,7 @@ SCM ly_parse_scm (char const* s, int* n); SCM ly_quote_scm (SCM s); SCM ly_type (SCM); bool type_check_assignment (SCM val, SCM sym, SCM type_symbol) ; +String print_scm_val (SCM val); SCM ly_number2string (SCM s); SCM parse_symbol_list (char const *); diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 12b925a567..cf15fbd962 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -607,6 +607,15 @@ SCM my_gh_symbol2scm (const char* x) return gh_symbol2scm ((char*)x); } +String +print_scm_val (SCM val) +{ + String realval = ly_scm2string (ly_write2scm (val)); + if (realval.length_i () > 200) + realval = realval.left_str (100) + "\n :\n :\n" + realval.right_str (100); + + return realval; +} bool type_check_assignment (SCM sym, SCM val, SCM type_symbol) @@ -647,14 +656,10 @@ type_check_assignment (SCM sym, SCM val, SCM type_symbol) SCM typefunc = scm_primitive_eval (ly_symbol2scm ("type-name")); SCM type_name = gh_call1 (typefunc, type_p); - String realval = ly_scm2string (ly_write2scm (val)); - if (realval.length_i () > 200) - realval = realval.left_str (100) + "\n :\n :\n" + realval.right_str (100); - - + scm_puts (_f ("Type check for `%s' failed; value `%s' must be of type `%s'", ly_symbol2string (sym).ch_C (), - realval.ch_C (), + print_scm_val (val), ly_scm2string (type_name).ch_C ()).ch_C (), errport); scm_puts ("\n", errport);