X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=scm%2Fc%2B%2B.scm;h=a455afdd78a4cf69116dd7809bc2f227cf9b0bd1;hb=e9e5132fe398480220731a3992b40c0f89c018bd;hp=f0c5d3aea9f546980949318d6498d1dcef483ba8;hpb=07f7ea94c774c7b746a0e7b703bc4a709b73eabf;p=lilypond.git diff --git a/scm/c++.scm b/scm/c++.scm index f0c5d3aea9..a455afdd78 100644 --- a/scm/c++.scm +++ b/scm/c++.scm @@ -1,6 +1,6 @@ ;;;; This file is part of LilyPond, the GNU music typesetter. ;;;; -;;;; Copyright (C) 1998--2012 Jan Nieuwenhuizen +;;;; Copyright (C) 1998--2015 Jan Nieuwenhuizen ;;;; Han-Wen Nienhuys ;;;; ;;;; LilyPond is free software: you can redistribute it and/or modify @@ -25,10 +25,19 @@ (and (pair? x) (number? (car x)) (number? (cdr x)))) +(define-public (number-pair-list? x) + (and (list? x) + (every number-pair? x))) + (define-public (fraction? x) (and (pair? x) (index? (car x)) (index? (cdr x)))) +(define-public (rational-or-procedure? x) + (or + (and (rational? x) (exact? x)) + (procedure? x))) + (define-public (number-or-grob? x) (or (ly:grob? x) (number? x))) @@ -45,9 +54,28 @@ (and (pair? x) (ly:moment? (car x)) (ly:moment? (cdr x)))) +(define-public (boolean-or-number? x) + (or (boolean? x) (number? x))) + (define-public (boolean-or-symbol? x) (or (boolean? x) (symbol? x))) +(define-public (key? x) + (or (symbol? x) (index? x))) + +(define-public (key-list? x) + (and (list? x) (every key? x))) + +(define-public (key-list-or-music? x) + (if (list? x) + (every key? x) + (ly:music? x))) + +(define-public (key-list-or-symbol? x) + (if (list? x) + (every key? x) + (symbol? x))) + (define-public (symbol-list? x) (and (list? x) (every symbol? x))) @@ -84,8 +112,6 @@ (define-public (scheme? x) #t) -(define-public (symbol-or-boolean? x) - (or (symbol? x) (boolean? x))) (define-public (void? x) (unspecified? x)) @@ -98,8 +124,8 @@ (if (null? alist) "Unknown type" (if (apply (caar alist) obj) - (cdar alist) - (match-predicate obj (cdr alist))))) + (cdar alist) + (match-predicate obj (cdr alist))))) (define-public (object-type obj) (match-predicate obj type-p-name-alist))