[racket] Typed racket and command line parameters
Hi there,
I try to change one of my programs to typed racket and fail because of
errors when dealing with command line arguments.
Here a minimum example:
#lang typed/racket/base
(require racket/cmdline)
(: opt-verbose-mode (Parameterof Boolean))
(define opt-verbose-mode (make-parameter #f))
(: opt-max-size (Parameterof Any))
(define opt-max-size (make-parameter "0"))
(define parms
(command-line
#:program "mypgm"
#:once-each
[("-v" "--verbose") "Show verbose output" (opt-verbose-mode #t)]
[("-m" "--max-size") NUM ("Max size." "NUM") (opt-max-size NUM) ]
))
(define (myfun)
(when (opt-verbose-mode)
(if (> (string->number (opt-max-size)) 0)
#t
#f)))
What do I do wrong? Any hint appreciated.
--
Thanks,
Manfred