From: David Kastrup Date: Sun, 30 Oct 2011 06:54:39 +0000 (+0100) Subject: Implement fraction? predicate checking for pair of unsigned integers X-Git-Tag: release/2.15.17-1~11 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=52746445ea483c3c7ea7d12eb96584b2baa7a40d;p=lilypond.git Implement fraction? predicate checking for pair of unsigned integers --- diff --git a/scm/c++.scm b/scm/c++.scm index 915e7e6283..5a5f8e0bad 100644 --- a/scm/c++.scm +++ b/scm/c++.scm @@ -25,6 +25,11 @@ (and (pair? x) (number? (car x)) (number? (cdr x)))) +(define-public (fraction? x) + (and (pair? x) + (integer? (car x)) (integer? (cdr x)) + (>= (car x) 0) (>= (cdr x) 0))) + (define-public (number-or-grob? x) (or (ly:grob? x) (number? x))) diff --git a/scm/lily.scm b/scm/lily.scm index 3ad7fb580e..4ab0164850 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -508,6 +508,7 @@ LilyPond safe mode. The syntax is the same as `define*-public'." `((,boolean-or-symbol? . "boolean or symbol") (,color? . "color") (,cheap-list? . "list") + (,fraction? . "fraction, as pair") (,grob-list? . "list of grobs") ;; this is built on cheap-list (,list-or-symbol? . "list or symbol")