What about command-line processing in racket do I not understand? For example, I just want to process the first argument as foo.html. From the command-line I run it as:
racket cmd.rkt foo.html
Unfortunately that just returns:
foo.html'#(#<void>)
Here's the code for cmd.rkt:
(for/vector ([i (current-command-line-arguments)])
(display i))
for/vector isn't called that because it iterates over vectors, it's called that because it accumulates the results of its body expression into a vector. So for each commandline argument it evaluates the display call, which prints the argument and returns #<void>, and accumulates the result into a vector of void values.
Use for instead and the problem will go away.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With