Closed lojic closed 1 year ago
(sigh) it appears this is likely not a bug :( Although the example compiled ok, I received the same error at the command line that I did from racket-mode when I actually ran the app. I forgot that aspect of compiling in racket-mode vs. command line. I'll mark closed.
Although I might be misunderstanding, I think this is a run-time not compile-time error because or/c
is a procedure, not syntax. And, at run-time, it's an error because a single procedure argument can't receive multiple values?
Having said all that if you gave me a pop-quiz I probably would have guessed wrongly that or/c
is syntax not a procedure, and tried to write exactly what you reasonably wanted to write.
You are correct. I should've looked up or/c
- I think I was just hoping the contract would magically work the way I wanted :) I think there is a way to get what I want with ->i
, but in the end, I just went with the simpler (values (orc/c ...) (or/c ...))
as I have more pressing matters. Glad to know racket-mode
is as solid as ever - I appreciate all you've done on it!
I get the following error in the racket-mode REPL:
When using a contract with
or/c
andvalues
. Here is a small reproducible example:An unsatisfactory workaround is to have
values
wrap theor/c
instead of theor/c
wrappingvalues
, but that would allow, for example,(values string? #f)
which is unacceptable.The example compiles ok at the command line, but not in
racket-mode
.Thanks!
Please copy all of the following lines and paste them into your bug report at https://github.com/greghendershott/racket-mode/issues/.