scm_internal_hash_fold() for iterating modules.
+2003-04-08 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ * lily/ly-module.cc (ly_copy_module_variables): use
+ scm_internal_hash_fold() for iterating modules.
+
2003-04-08 Juergen Reuter <reuter@ipd.uka.de>
* Documentation/user/refman.itely: Section Custodes: added more
2003-04-08 Juergen Reuter <reuter@ipd.uka.de>
* Documentation/user/refman.itely: Section Custodes: added more
accessed directly using text markup such as
@code{g^\markup @{ \musicglyph #"scripts-segno" @}}, see @ref{Text markup}.
accessed directly using text markup such as
@code{g^\markup @{ \musicglyph #"scripts-segno" @}}, see @ref{Text markup}.
@lilypondfile[noindent]{feta16list.ly}
@lilypondfile[noindent]{feta16list.ly}
-@c parmesan is too big. Apparently pythons re's choke on this.
-@c @lil ypondfile{parmesan16list.ly}
+
+@lilypondfile[noindent]{parmesan16list.ly}
@end html
@end ifhtml
""" % n
@end html
@end ifhtml
""" % n
\score{
\notes \relative c''{
\score{
\notes \relative c''{
- \slurUp c8(()c())c4
- \slurDown a8(()a)a4
+ \slurUp c8((c-)(c4-))
+ \slurDown a8-(-(a-)a4-)
\break
\slurDown a8(()a())a4
\break
\slurDown a8(()a())a4
c:3-.5-.7- = \markup { \super " o" }
%% Hmm
c:3-.5-.7- = \markup { \super " o" }
%% Hmm
- %% ;;Pick your favorite maj7
- %% ((0) mathm-markup-object) ;;a white triangle
- %% ;;((0) mathn-markup-object) ;;a black triangle
- %% ;;((0) (make-simple-markup "maj7")) ;;good old maj7
%% This ok?
c:7+ = \markup { \normal-size-super \override #'(font-family . math) "N" }
%% This ok?
c:7+ = \markup { \normal-size-super \override #'(font-family . math) "N" }
- %%c:3.5.7 = \markup { \override #'(font-family . math) "M" }
- %%c:3.5.7 = \markup { \normal-size-super "maj7" }
}
epartial = \chordnames {
}
epartial = \chordnames {
{
SCM s = anon_modules;
anon_modules = SCM_EOL;
{
SCM s = anon_modules;
anon_modules = SCM_EOL;
for (; gh_pair_p (s) ; s = gh_cdr (s))
{
for (; gh_pair_p (s) ; s = gh_cdr (s))
{
- scm_vector_fill_x (SCM_MODULE_OBARRAY(gh_car(s)), SCM_EOL);
+ SCM tab= scm_c_make_hash_table (2);
+ /*
+ UGH.
+ */
+
+ SCM_STRUCT_DATA(gh_car(s))[scm_module_index_obarray] = (long unsigned int) tab;
}
}
#define FUNC_NAME __FUNCTION__
}
}
#define FUNC_NAME __FUNCTION__
+SCM
+define_one_var (void * closure, SCM key, SCM val, SCM result)
+{
+ SCM dest = (SCM) closure;
+ scm_module_define (dest, key, scm_variable_ref (val));
+ return SCM_EOL;
+}
+
+typedef SCM (*Hash_cl_func)();
+
void
ly_copy_module_variables (SCM dest, SCM src)
{
SCM_VALIDATE_MODULE (1, src);
SCM obarr= SCM_MODULE_OBARRAY(src);
void
ly_copy_module_variables (SCM dest, SCM src)
{
SCM_VALIDATE_MODULE (1, src);
SCM obarr= SCM_MODULE_OBARRAY(src);
+ scm_internal_hash_fold ((Hash_cl_func) &define_one_var, (void*) dest, SCM_EOL, obarr);
+}
- for (int i = 0; i < SCM_VECTOR_LENGTH (obarr); i++)
- {
- for( SCM s = scm_vector_ref(obarr, SCM_MAKINUM (i));
- gh_pair_p (s); s = gh_cdr (s))
- {
- scm_module_define (dest, gh_caar (s), scm_variable_ref (gh_cdar(s)));
- }
- }
+SCM
+accumulate_symbol (void * closure, SCM key, SCM val, SCM result)
+{
+ return scm_cons (key, result);
SCM_VALIDATE_MODULE (1, mod);
SCM obarr= SCM_MODULE_OBARRAY(mod);
SCM_VALIDATE_MODULE (1, mod);
SCM obarr= SCM_MODULE_OBARRAY(mod);
- SCM syms = SCM_EOL;
-
- for (int i = 0; i < SCM_VECTOR_LENGTH (obarr); i++)
- {
- for( SCM s = scm_vector_ref(obarr, SCM_MAKINUM (i));
- gh_pair_p (s); s = gh_cdr (s))
- {
- syms = scm_cons (gh_caar (s), syms);
- }
- }
- return syms;
+ return scm_internal_hash_fold ((Hash_cl_func) &accumulate_symbol, NULL, SCM_EOL, obarr);
+SCM
+entry_to_alist (void * closure, SCM key, SCM val, SCM result)
+{
+ return scm_cons (scm_cons (key, scm_variable_ref (val)), result);
+}
SCM
ly_module_to_alist (SCM mod)
SCM
ly_module_to_alist (SCM mod)
SCM obarr= SCM_MODULE_OBARRAY(mod);
SCM obarr= SCM_MODULE_OBARRAY(mod);
- for (int i = 0; i < SCM_VECTOR_LENGTH (obarr); i++)
- {
- for( SCM s = scm_vector_ref(obarr, SCM_MAKINUM (i));
- gh_pair_p (s); s = gh_cdr (s))
- {
- alist = scm_acons (gh_caar (s), scm_variable_ref (gh_cdar (s)),
- alist);
- }
- }
- return alist;
+ return scm_internal_hash_fold ((Hash_cl_func) &entry_to_alist, NULL, SCM_EOL, obarr);
MAKE_SCHEME_CALLBACK (Multi_measure_rest, set_spacing_rods,1);
MAKE_SCHEME_CALLBACK (Multi_measure_rest, set_spacing_rods,1);
SCM
Multi_measure_rest::set_spacing_rods (SCM smob)
{
SCM
Multi_measure_rest::set_spacing_rods (SCM smob)
{
rod.distance_ = l->extent (l, X_AXIS)[BIGGER] - r->extent (r, X_AXIS)[SMALLER]
+ sym_width + 2.0; // 2.0 = magic!
rod.distance_ = l->extent (l, X_AXIS)[BIGGER] - r->extent (r, X_AXIS)[SMALLER]
+ sym_width + 2.0; // 2.0 = magic!
+ Real minlen =0.0;
+ SCM ml =me->get_grob_property ("minimum-length");
+ if (gh_number_p (ml)) minlen = gh_scm2double (ml);
rod.distance_ = max(rod.distance_,
rod.distance_ = max(rod.distance_,
- gh_scm2double (me->get_grob_property ("minimum-length")));
rod.add_to_cols ();
}
return SCM_UNSPECIFIED;
rod.add_to_cols ();
}
return SCM_UNSPECIFIED;
$(outdir)/$(NAME).tely: $(LY_FILES)
$(outdir)/$(NAME).tely: $(LY_FILES)
- $(PYTHON) ../../buildscripts/lys-to-tely.py --name=$(outdir)/collated-files.html --title="$(TITLE)" $(LY_FILES)
+ $(PYTHON) ../../buildscripts/lys-to-tely.py --name=$(outdir)/collated-files --title="$(TITLE)" $(LY_FILES)