Summary

Egg SRFI-37 - wrong result

Metadata

Description

Egg srfi-37 seems to have a problem:

 Type ,? for help.
 #;1> (import (srfi 37))
 ; loading /home/jeronimo/pkg/scheme/chicken/ROOT-git/lib/chicken-git/11/srfi-37.import.so ...
 ; loading /home/jeronimo/pkg/scheme/chicken/ROOT-git/lib/chicken-git/11/srfi-37.so ...
 #;2> (args-fold '("-I" "the-argument")
            (list (option '(#\I) #f #t
                          (lambda (opt name arg result)
                            (and (eqv? name #\I) arg))))
            (lambda args (error "unrecognized"))
            (lambda args #f)
            #f)
 #f
 #;4>

But it should have returned the argument value ("the-argument").

If, instead of '("-I" "the-argument"), you pass it '("-Ithe-argument"), then it will correctly recognize -I's argument, "the-argument".

Several implementations seem to do the same, so perhaps this is a bug in the reference implementation?