X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fc%2B%2B.scm;h=f0c5d3aea9f546980949318d6498d1dcef483ba8;hb=59c80dd7c20f5ae8024a7ab0957726c21704c924;hp=74f58f4da3f4da2449535f0faf6ca1034c85dcd0;hpb=55ac733b69643a6bc6a83b706c65cb56efd388ef;p=lilypond.git diff --git a/scm/c++.scm b/scm/c++.scm index 74f58f4da3..f0c5d3aea9 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--2011 Jan Nieuwenhuizen +;;;; Copyright (C) 1998--2012 Jan Nieuwenhuizen ;;;; Han-Wen Nienhuys ;;;; ;;;; LilyPond is free software: you can redistribute it and/or modify @@ -25,12 +25,22 @@ (and (pair? x) (number? (car x)) (number? (cdr x)))) +(define-public (fraction? x) + (and (pair? x) + (index? (car x)) (index? (cdr x)))) + (define-public (number-or-grob? x) (or (ly:grob? x) (number? x))) (define-public (grob-list? x) (list? x)) +(define-public (number-list? x) + (and (list? x) (every number? x))) + +(define-public (index? x) + (and (integer? x) (>= x 0))) + (define-public (moment-pair? x) (and (pair? x) (ly:moment? (car x)) (ly:moment? (cdr x)))) @@ -38,29 +48,48 @@ (define-public (boolean-or-symbol? x) (or (boolean? x) (symbol? x))) +(define-public (symbol-list? x) + (and (list? x) (every symbol? x))) + +(define-public (symbol-list-or-music? x) + (if (list? x) + (every symbol? x) + (ly:music? x))) + (define-public (string-or-symbol? x) (or (string? x) (symbol? x))) (define-public (number-or-string? x) (or (number? x) (string? x))) +(define-public (number-or-markup? x) + (or (number? x) (markup? x))) + (define-public (string-or-pair? x) (or (string? x) (pair? x))) +(define-public (string-or-music? x) + (or (string? x) (ly:music? x))) + (define-public (number-or-pair? x) (or (number? 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 (symbol-list-or-symbol? x) + (if (list? x) + (every symbol? x) + (symbol? x))) (define-public (scheme? x) #t) (define-public (symbol-or-boolean? x) (or (symbol? x) (boolean? x))) +(define-public (void? x) + (unspecified? x)) + ;; moved list to end of lily.scm: then all type-predicates are ;; defined. (define type-p-name-alist '())