For a complex syntax form like `command-line`, I have difficulty correctly
annotate the bindings it defines.
More specifically, in the below code, for variable `msg`, even the document
says the `#:args` binds as list of **strings**, but the error indicates that it
somehow is declared as `Listof Any`.
Similarly, for variable `ch` bound in line 11, I believe it should always be
`String`, but it somehow is declared to be `Any`.
What should I do with this type of error, if I want my varaibles to be more
precisely typed than just `Any`?
1 #lang typed/racket
3 (define *channel* (make-parameter "#general"))
4 (define *message* : (Parameterof (Listof String)) (make-parameter '()))
7 (define (parse-cmdline)
9 #:program "q"
11 [("-c" "--channel") ch "slack channel to post (default: use .qrc
setting or default)" (*channel* ch)]
12 #:args msg
13 (*message* msg)))
17 tr.rkt:11:91: Type Checker: Wrong argument to parameter - expected
String and got Any in: (*channel* ch)
18 tr.rkt:13:5: Type Checker: Wrong argument to parameter - expected
(Listof String) and got (Listof Any) in: (*message* msg)
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.