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