2 symbol-cache.cc -- implement a cache for literal symbols, eg
6 source file of the GNU LilyPond music typesetter
8 (c) 2000--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
13 #include "lily-guile.hh"
17 typedef map
<const char*, SCM
> Literal_symbol_map
;
18 Literal_symbol_map literal_map
;
24 Literal_symbol_map::const_iterator i
= literal_map
.find (s
);
25 if (i
!= literal_map
.end ())
28 SCM sym
= gh_symbol2scm ((char*)s
);
29 scm_permanent_object (sym
);
36 This is a gory trick to cache the value gh_symbol2scm (), without
37 cluttering up the C code with snarf macros.
39 You should *ONLY* use symbol () for arguments that are literal
61 global with binsearch.
71 local with binsearch, and other optimizations.