I have these functions here
(define (greetfmt name)
(string-append "Hello " name "!"))
(define (auth? name)
(or
(eq? name "alice")
(eq? name "bob")))
(define (greet name)
;;(if (auth? name)
(if (auth? (string-downcase name))
(greetfmt name)
"Huh?"))
When I use (string-downcase)
the comparison operator fails.
With downcase. This happens for any input:
> (greet "alice")
"Huh?"
Without downcase:
> (greet "alice")
"Hello alice!"
> (greet "grafcube")
"Huh?"
This makes me think that downcase is doing something else to the string but after debugging for a while I haven't figured out what the problem is. Any help is appreciated.