;;;; This file is part of LilyPond, the GNU music typesetter.
;;;;
-;;;; Copyright (C) 1998--2009 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;; Copyright (C) 1998--2010 Jan Nieuwenhuizen <janneke@gnu.org>
;;;; Han-Wen Nienhuys <hanwen@xs4all.nl>
;;;;
;;;; LilyPond is free software: you can redistribute it and/or modify
(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)))
(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.
(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))
+ #\?))))