X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fc%2B%2B.scm;h=bccd15ed02b0be8e29fa01f3da2237f6f1720bc9;hb=553f6aa21a21d0ba7ae3ee48bce121154590bf8b;hp=ee4de99005758b11de20e9de53a1e0cdb0349a83;hpb=0387f04497978e37b335a8b99eec905499d6ad0f;p=lilypond.git diff --git a/scm/c++.scm b/scm/c++.scm index ee4de99005..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--2008 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"))