0
如何在雞中使用getopt-long
?如何在雞中使用getopt-long
我有下面的代碼:
(require 'getopt-long)
(define grammar
`((help (required #f)
(value #f)
(single-char #\h))
(limit (required #t)
(value #f) ;; optional value
(single-char #\l)
(value (required INTEGER)
(predicate ,integer?)))
))
(getopt-long '(program-arguments) grammar)
但是,當我嘗試使用csi
運行的代碼,我得到以下錯誤:
Error: unbound variable: getopt-long
Call history:
<eval> (##sys#list (##sys#list (##core#quote help) (##sys#list (##core#quote required) (##core#quote #f)) (......
<eval> (##sys#list (##core#quote help) (##sys#list (##core#quote required) (##core#quote #f)) (##sys#list (......
<eval> (##sys#list (##core#quote required) (##core#quote #f))
<eval> (##sys#list (##core#quote value) (##core#quote #f))
<eval> (##sys#list (##core#quote single-char) (##core#quote #\h))
<eval> (##sys#list (##core#quote limit) (##sys#list (##core#quote required) (##core#quote #t)) (##sys#list ...
<eval> (##sys#list (##core#quote required) (##core#quote #t))
<eval> (##sys#list (##core#quote value) (##core#quote #f))
<eval> (##sys#list (##core#quote single-char) (##core#quote #\l))
<eval> (##sys#list (##core#quote value) (##sys#list (##core#quote required) (##core#quote INTEGER)) (##sys#......
<eval> (##sys#list (##core#quote required) (##core#quote INTEGER))
<eval> (##sys#list (##core#quote predicate) integer?)
<syntax> (getopt-long (quote (program-arguments)) grammar)
<syntax> (quote (program-arguments))
<syntax> (##core#quote (program-arguments))
<eval> (getopt-long (quote (program-arguments)) grammar) <--
什麼想法?
yup。這就是使用(使用...);)的方式。將其標記爲已解決的問題。 – ramrunner