2 lily-guile.cc -- implement assorted guile functions
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
8 Han-Wen Nienhuys <hanwen@cs.uu.nl>
12 #include "libc-extension.hh"
13 #include "lily-guile.hh"
15 #include "simple-file-storage.hh"
16 #include "file-path.hh"
21 scm_m_quote doesn't use any env, but needs one for a good signature in GUILE.
23 Why there is no gh_quote () in GUILE beats me.
29 return scm_cons2 (scm_i_quote, s, SCM_EOL);
33 See: libguile/symbols.c
36 scm_string_to_symbol(s)
40 ly_symbol (String name)
42 return gh_car (scm_intern (name.ch_C(), name.length_i()));
46 symbol_to_string (SCM s)
48 return String((Byte*)SCM_CHARS (s), (int) SCM_LENGTH(s));
52 ly_set_scm (String name, SCM val)
54 return scm_sysintern (name.ch_C(), val);
59 Read a file, and shove it down GUILE. GUILE also has file read
60 functions, but you can't fiddle with the path of those.
64 read_lily_scm_file (String fn)
66 String s = global_path.find (fn);
69 String e = _f ("Can not find file `%s\'", fn);
71 e += _f ("(Load path is `%s\'", global_path.str ());
78 Simple_file_storage f(s);
80 gh_eval_str ((char *) f.ch_C());
81 *mlog << ']' << flush;
86 ly_display_scm (SCM s)