Summary
Egg SRFI-37 - wrong result
Metadata
- Id: 3f09db4f641c861dec9f44e88d28cd4f2c29ce8a
- Trac id: 1701
- Type: defect
- Reporter: jeronimo
- Owner:
- Cc:
- Status: new
- Component: extensions
- Estimated difficulty:
- Resolution:
- Priority: minor
- Milestone: someday
- Version: 5.2.0
- Changetime: 2020-07-06 23:14:26 UTC
- Created: 2020-07-06 23:14:26 UTC
- Keywords:
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?