X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fc%2B%2B.scm;h=bccd15ed02b0be8e29fa01f3da2237f6f1720bc9;hb=68bcf843016f5ade4087a00f3fe09a333270d37e;hp=800d08bfe6b8f2578edeb7ff5c198660d628c12e;hpb=0f224ac096e1285d91fcea83ec8368c18ef5cf9c;p=lilypond.git diff --git a/scm/c++.scm b/scm/c++.scm index 800d08bfe6..bccd15ed02 100644 --- a/scm/c++.scm +++ b/scm/c++.scm @@ -1,8 +1,8 @@ ;;;; c++.scm -- implement Scheme frontends to C++ functions ;;;; ;;;; source file of the GNU LilyPond music typesetter -;;;; -;;;; (c) 1998--2006 Jan Nieuwenhuizen +;;;; +;;;; (c) 1998--2009 Jan Nieuwenhuizen ;;;; Han-Wen Nienhuys ;;; Note: this file can't be used without LilyPond executable @@ -33,12 +33,21 @@ (define-public (number-or-string? x) (or (number? x) (string? x))) +(define-public (string-or-pair? x) + (or (string? x) (pair? x))) + +(define-public (cheap-list? x) + (or (pair? x) (null? x))) + +(define-public (list-or-symbol? x) + (or (cheap-list? x) (symbol? x))) + (define-public (scheme? x) #t) ;; moved list to end of lily.scm: then all type-predicates are ;; defined. -(define type-p-name-alist '()) +(define type-p-name-alist '()) (define (match-predicate obj alist) (if (null? alist) @@ -54,6 +63,4 @@ (type-name (match-predicate obj type-p-name-alist))) (define-public (type-name predicate) - (let ((entry (assoc predicate type-p-name-alist))) - (if (pair? entry) (cdr entry) - "unknown"))) + (assoc-get predicate type-p-name-alist "unknown"))