Welcome to the CHICKEN Scheme pasting service

Map arguments to macro. added by Buglouse on Tue May 10 01:48:43 2016

 -s

#|
Want: To define a list and pass to the macro (args:make-option) to avoid writing multiple "args:make-option" lines.

args:make-option is called as:
(args:parse (command-line-arguments)
            (list
             (args:make-option (h help) (#:none "Help.") (print "Help."))
             (args:make-option (f foo) (#:none "Foo.") "Foo.")))

|#


(use args)
(define OPTS '(((h help) (#:none "Help") "Print help."
                (option-info))
               ((f foo) (#:none "Foo.") "Foo.")
               ))
(define (option-records #!optional (opts OPTS))
  (list
  (map (lambda (opt)
         (eval `(args:make-option ,@opt)))
       ;; Error: bad argument type - not a structure of the required type
       ;; (#<args:option> #<args:option>)
       opts)))

(args:usage (option-records))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
What does `(string? 42)' produce?
Visually impaired? Let me spell it for you (wav file) download WAV