~ubuntu-branches/ubuntu/precise/lilypond/precise

« back to all changes in this revision

Viewing changes to scm/c++.scm

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Bushnell, BSG
  • Date: 2006-12-19 10:18:12 UTC
  • mfrom: (3.1.4 feisty)
  • Revision ID: james.westby@ubuntu.com-20061219101812-7awtjkp0i393wxty
Tags: 2.8.7-3
scripts/midi2ly.py: When setting DATADIR, find Lilypond python files
in the @TOPLEVEL_VERSION@ directory, not 'current'.  Patch thanks to
Chris Lamb (chris@chris-lamb.co.uk).  (Closes: #400550)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
;;;;
3
3
;;;;  source file of the GNU LilyPond music typesetter
4
4
;;;; 
5
 
;;;; (c)  1998--2004 Jan Nieuwenhuizen <janneke@gnu.org>
6
 
;;;; Han-Wen Nienhuys <hanwen@cs.uu.nl>
 
5
;;;; (c) 1998--2006 Jan Nieuwenhuizen <janneke@gnu.org>
 
6
;;;;                 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7
7
 
8
8
;;; Note: this file can't be used without LilyPond executable
9
9
 
10
10
 
11
11
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
12
12
;; type predicates.
13
 
(define-public (number-pair?  x)
 
13
(define-public (number-pair? x)
14
14
  (and (pair? x)
15
15
       (number? (car x)) (number? (cdr x))))
 
16
 
16
17
(define-public (number-or-grob? x)
17
 
  (or (ly:grob? x) (number? x))
18
 
  )
 
18
  (or (ly:grob? x) (number? x)))
19
19
 
20
20
(define-public (grob-list? x)
21
21
  (list? x))
22
22
 
23
 
(define-public (moment-pair?  x)
 
23
(define-public (moment-pair? x)
24
24
  (and (pair? x)
25
25
       (ly:moment? (car x)) (ly:moment? (cdr x))))
26
26
 
33
33
(define-public (scheme? x) #t)
34
34
 
35
35
 
36
 
 
37
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
38
 
;;
39
 
 
40
 
 
41
36
;; moved list to end of lily.scm: then all type-predicates are
42
37
;; defined.
43
38
(define type-p-name-alist '()) 
47
42
      "Unknown type"
48
43
      (if (apply (caar alist) obj)
49
44
          (cdar alist)
50
 
          (match-predicate obj (cdr alist))
51
 
          )
52
 
      ))
 
45
          (match-predicate obj (cdr alist)))))
53
46
 
54
47
(define-public (object-type obj)
55
48
  (match-predicate obj type-p-name-alist))
56
49
 
57
 
(define-public (type-name  predicate)
 
50
(define-public (type-name predicate)
58
51
  (let ((entry (assoc predicate type-p-name-alist)))
59
52
    (if (pair? entry) (cdr entry)
60
 
        "unknown"
61
 
        )))
 
53
        "unknown")))