guile-devel
[Top][All Lists]
Advanced

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

Re: Bug in getopt-long?


From: Thien-Thi Nguyen
Subject: Re: Bug in getopt-long?
Date: Tue, 31 Jul 2001 23:38:35 -0700

   From: Daniel Skarda <address@hidden>
   Date: 28 Jul 2001 18:32:07 +0000

     (define (test1 . args)
       (getopt-long  args
         `((test (value #t)
                 (predicate ,(lambda (x) (string-match "^[0-9]+$" x)))))))

     (test1 "foo" "bar")

        [error] option predicate failed: test              !!! HUH !!!

     Huh! It looks like that presence of `predicate' implies that
   argument is required. I have not studied (ice-9 getopt-long) module
   sources but this strange behaviour is not documented (not even
   expected :-)

actually this looks ok to me -- `test' is specified w/ `(value #t)',
meaning that it is invalid to not have an associated argument.  the
error message could be more clear, however (something along the lines of
"missing argument: test").

thi



reply via email to

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