Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sébastien Villemot
antik
Commits
9fcf39af
Commit
9fcf39af
authored
May 31, 2013
by
Liam M. Healy
Browse files
Check that a named parameter exists
Check that a named parameter exists and signal an error if it does not.
parent
8d4bd257
Changes
1
Hide whitespace changes
Inline
Side-by-side
input-output/parameters.lisp
View file @
9fcf39af
;; Global/local parameters to pass to functions
;; Liam Healy 2013-02-16 20:51:14HST variable-metadata.lisp
;; Time-stamp: <2013-05-
29 12:21:19
EDT parameters.lisp>
;; Time-stamp: <2013-05-
31 18:12:51
EDT parameters.lisp>
;; Copyright 2011, 2013 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
...
...
@@ -92,7 +92,12 @@
(
remove-if-not
(
lambda
(
p
)
(
eq
(
symbol-package
p
)
pkg
))
*parameters*
))))
(
defun
find-parameter
(
category
name
)
(
canonical-parameter-name
(
find-parameter-symbol
category
name
)))
"Find the registered parameter."
(
let
((
symbol
(
find-parameter-symbol
category
name
)))
(
multiple-value-bind
(
can
found
)
(
canonical-parameter-name
symbol
)
(
if
found
can
(
error
"Parameter ~a:~a not defined."
category
name
)))))
;;;;****************************************************************************
;;;; Definition and use
...
...
@@ -205,13 +210,15 @@
append
(
list
`
(
parameter-value
,
category
,
(
first
nv
))
(
second
nv
)))))
,@
body
))
(
with-parameters
(
nf
(
no-units
t
))
(
foorbar
))
;;;
#+
(
or
)
(
with-parameters
(
:nf
(
:style
44
))
(
foobar
(
parameter-value
:nf
:style
)))
#+
(
or
)
(
with-parameters
(
:nf
(
:zibble
44
))
(
foobar
(
parameter-value
:nf
:zibble
)))
;;;;****************************************************************************
;;;; Help
;;;;****************************************************************************
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment