]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lily-guile.cc
2003 -> 2004
[lilypond.git] / lily / lily-guile.cc
index 104fffc3ba0837624f4e811135c4c9cea574108d..4cd7a34554bb2beaa56cbd95e4c34010d31d9d2c 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1998--2003 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c) 1998--2004 Jan Nieuwenhuizen <janneke@gnu.org>
 
   Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
@@ -768,3 +768,20 @@ robust_scm2int (SCM k, int o)
 
   return o;
 }
+
+
+SCM
+alist_to_hashq (SCM alist)
+{
+  int i = scm_ilength (alist);
+  if (i < 0)
+    return scm_make_vector (gh_int2scm (0), SCM_EOL);
+         
+  SCM tab = scm_make_vector (gh_int2scm (i), SCM_EOL);
+  for (SCM s = alist; gh_pair_p (s); s = ly_cdr (s))
+    {
+      SCM pt = ly_cdar (s);
+      scm_hashq_set_x (tab, ly_caar (s), pt);
+    }
+  return tab; 
+}