﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	difficulty
1289	getopt-long (value #f) inconsistent with documentation	Norman Gray		"The documentation for `getopt-long` says that 

    (value FLAG [(PROPERTY VALUE) ...])
    If FLAG is #t, the option requires a value;...

and

    (predicate FUNC)
    If the option accepts a value (i.e. you specified (value #t) for this option)...

These would seem to indicate that `(value #t (predicate ,string))` would be acceptable, but the following program fails:

{{{
(use getopt-long)

(define grammar
  `((test (single-char #\t)
          (value #t ;(required ""REQ"")
                 (predicate ,string?)))))

(write
 (getopt-long '(""my-prog"" ""-t"" ""foo"")
              grammar))
(newline)
}}}

Result:

{{{
% csi getopt-long-demo.scm

CHICKEN
(c) 2008-2015, The CHICKEN Team
(c) 2000-2007, Felix L. Winkelmann
Version 4.10.0 (rev b259631)
macosx-unix-clang-x86-64 [ 64bit manyargs dload ptables ]
compiled 2015-08-04 on yves.more-magic.net (Linux)

; loading getopt-long-demo.scm ...
; loading /Data/tools/chicken-4.10.0/lib/chicken/7/getopt-long.import.so ...
; loading /Data/tools/chicken-4.10.0/lib/chicken/7/chicken.import.so ...
; loading /Data/tools/chicken-4.10.0/lib/chicken/7/data-structures.import.so ...
; loading /Data/tools/chicken-4.10.0/lib/chicken/7/srfi-1.import.so ...
; loading /Data/tools/chicken-4.10.0/lib/chicken/7/srfi-13.import.so ...
; loading /Data/tools/chicken-4.10.0/lib/chicken/7/srfi-14.import.so ...
; loading /Data/tools/chicken-4.10.0/lib/chicken/7/matchable.import.so ...
; loading /Data/tools/chicken-4.10.0/lib/chicken/7/lolevel.import.so ...
; loading /Data/tools/chicken-4.10.0/lib/chicken/7/getopt-long.so ...
; loading /Data/tools/chicken-4.10.0/lib/chicken/7/matchable.so ...

Error: invalid value specification : (#t (predicate #<procedure (string? x463)>))

}}}

Replacing the `#t` with `(required ""REQ"")` works as expected."	defect	closed	major	someday	extensions	4.10.x	fixed	getopt-long		
