lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 11/16] Replace the rather fuzzy list-or-symbol? with symbol-list-


From: David Kastrup
Subject: [PATCH 11/16] Replace the rather fuzzy list-or-symbol? with symbol-list-or-symbol?
Date: Tue, 9 Oct 2012 20:59:56 +0200

list-or-symbol? was previously used in the meaning of
symbol-list-or-symbol? only, and there is no point in not checking the
list members for actually being symbols, in order to avoid ugly
surprises later.
---
 ly/music-functions-init.ly |    2 +-
 ly/property-init.ly        |    2 +-
 scm/c++.scm                |    6 ++++--
 scm/lily.scm               |    3 +--
 4 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly
index 2180b89..3c60565 100644
--- a/ly/music-functions-init.ly
+++ b/ly/music-functions-init.ly
@@ -1227,7 +1227,7 @@ the `parameters' assoc list.")
 
 styledNoteHeads =
 #(define-music-function (parser location style heads music)
-   (symbol? list-or-symbol? ly:music?)
+   (symbol? symbol-list-or-symbol? ly:music?)
    (_i "Set @var{heads} in @var{music} to @var{style}.")
    (style-note-heads heads style music))
 
diff --git a/ly/property-init.ly b/ly/property-init.ly
index caf6ad0..3a88098 100644
--- a/ly/property-init.ly
+++ b/ly/property-init.ly
@@ -365,7 +365,7 @@ back to the lilypond source statement.")
    (make-music 'SequentialMusic 'void #t))
 
 pointAndClickTypes =
-#(define-void-function (parser location types) (list-or-symbol?)
+#(define-void-function (parser location types) (symbol-list-or-symbol?)
   (_i "Set a type or list of types (such as @code{#'note-event}) for which 
point-and-click info is generated.")
   (ly:set-option 'point-and-click types))
 
diff --git a/scm/c++.scm b/scm/c++.scm
index 12c38a3..8d1df2a 100644
--- a/scm/c++.scm
+++ b/scm/c++.scm
@@ -74,8 +74,10 @@
 (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)
 
diff --git a/scm/lily.scm b/scm/lily.scm
index 268fd1c..4263ab4 100644
--- a/scm/lily.scm
+++ b/scm/lily.scm
@@ -562,8 +562,6 @@ messages into errors.")
     (,fraction? . "fraction, as pair")
     (,grob-list? . "list of grobs")
     (,index? . "non-negative integer")
-    ;; this is built on cheap-list
-    (,list-or-symbol? . "list or symbol")
     (,markup? . "markup")
     (,markup-command-list? . "markup command list")
     (,markup-list? . "markup list")
@@ -580,6 +578,7 @@ messages into errors.")
     (,string-or-symbol? . "string or symbol")
     (,symbol-list? . "symbol list")
     (,symbol-list-or-music? . "symbol list or music")
+    (,symbol-list-or-symbol? . "symbol list or symbol")
     (,void? . "void")
     ))
 
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]