]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lily-guile.cc
release: 1.3.30
[lilypond.git] / lily / lily-guile.cc
index ccca3060e97edf6a8ff7e262ff7c1cabd9aaaf38..09eca147be7af061886b97d7e5fdeafd8ef6d8bd 100644 (file)
@@ -339,3 +339,31 @@ scm_to (SCM s, Offset*)
   return Offset (gh_scm2double (gh_car (s)),
                 gh_scm2double (gh_cdr (s)));
 }
+
+SCM
+ly_type (SCM exp)
+{
+  char const  * cp = "unknown";
+  if (gh_number_p (exp))
+    {
+      cp = "number";
+    }
+  else if (gh_string_p (exp))
+    {
+      cp = "string";
+    }
+  else if (gh_procedure_p (exp))
+    {
+      cp = "procedure";
+    }
+  else if (gh_boolean_p (exp))
+    {
+      cp = "boolean";
+    }
+  else if (gh_pair_p (exp))
+    {
+      cp = "list";
+    }
+
+  return ly_str02scm (cp);
+}