[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Output better message for wrong argument of dash-definiton (issue 321400
From: |
thomasmorley65 |
Subject: |
Output better message for wrong argument of dash-definiton (issue 321400043 by address@hidden) |
Date: |
Tue, 01 Aug 2017 10:17:43 -0700 |
Reviewers: ,
Message:
Please review
Description:
Output better message for wrong argument of dash-definiton
Previously an argument like '(0 1.0 0.5 0.5) passed the
pair?-typecheck, segfaulting later.
Thus a new predicate, list-of-lists? is introduced.
Please review this at https://codereview.appspot.com/321400043/
Affected files (+4, -1 lines):
M scm/c++.scm
M scm/define-grob-properties.scm
Index: scm/c++.scm
diff --git a/scm/c++.scm b/scm/c++.scm
index
a455afdd78a4cf69116dd7809bc2f227cf9b0bd1..57ea44f72c39e5a002b7589d725aaa388d326dae
100644
--- a/scm/c++.scm
+++ b/scm/c++.scm
@@ -105,6 +105,9 @@
(define-public (cheap-list? x)
(or (pair? x) (null? x)))
+(define-public (list-of-lists? x)
+ (and (list? x) (every list? x)))
+
(define-public (symbol-list-or-symbol? x)
(if (list? x)
(every symbol? x)
Index: scm/define-grob-properties.scm
diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm
index
0acc741f1cb93ad13ffa151b8fafc745df9037f0..1faab2a21be119e8b96c7c2114bc7398e64f43f4
100644
--- a/scm/define-grob-properties.scm
+++ b/scm/define-grob-properties.scm
@@ -210,7 +210,7 @@ increments from this initial value.")
;;; d
;;;
(damping ,number? "Amount of beam slope damping.")
- (dash-definition ,pair? "List of @code{dash-elements} defining the
+ (dash-definition ,list-of-lists? "List of @code{dash-elements}
defining the
dash structure. Each @code{dash-element} has a starting t value,
an ending t-value, a @code{dash-fraction}, and a @code{dash-period}.")
(dash-fraction ,number? "Size of the dashes, relative to
- Output better message for wrong argument of dash-definiton (issue 321400043 by address@hidden),
thomasmorley65 <=