]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/c++.scm
Merge branch 'lilypond/translation'
[lilypond.git] / scm / c++.scm
index 362e358b34d9929bf74f158ccdf31d7178e0fdf3..204f813d4736388030db061ed5eea3927ec62cf6 100644 (file)
@@ -47,6 +47,9 @@
 (define-public (string-or-pair? x)
   (or (string? x) (pair? x)))
 
+(define-public (number-or-pair? x)
+  (or (number? x) (pair? x)))
+
 (define-public (cheap-list? x)
   (or (pair? x) (null? x)))
 
@@ -55,6 +58,8 @@
 
 (define-public (scheme? x) #t)
 
+(define-public (symbol-or-boolean? x)
+  (or (symbol? x) (boolean? x)))
 
 ;; moved list to end of lily.scm: then all type-predicates are
 ;; defined.
@@ -74,4 +79,8 @@
   (type-name (match-predicate obj type-p-name-alist)))
 
 (define-public (type-name predicate)
-  (assoc-get predicate type-p-name-alist "unknown"))
+  (let ((entry (assoc predicate type-p-name-alist)))
+    (if (pair? entry) (cdr entry)
+        (string-trim-right
+         (symbol->string (procedure-name predicate))
+         #\?))))