Open saracen opened 1 month ago
Hi @saracen, I agree about the multiple expressions on a line being odd that it’s allowed. I’ll make a change to disallow it. I’ve been aware of it but no one has brought it up as an issue yet.
The map built in example is a bit tricky. I see that it could be a common source of confusion. Maybe renaming or removing that built in by default would be fine. IIRC that was built to be like the “dict” constructor in python.
Thanks for evaluating Risor and feel free to reach out with more suggestions. You could join the risor channel on the gophers slack too if you want.
Hey @myzie
I've recently been evaluating risor for a project and was surprised by this being allowed:
and
I understand that this is because each of these are individual expressions, and they're not invalid, but it can account for some weird errors if you're not too familiar with the language. For example, I mistakening thought that to create a map, I needed to use the syntax
map{a: 123}
. Butmap
is a built-in.Rather than a parser or compile error, you get a runtime error of
type error: object is not a container (got builtin)
which is a little confusing.Do you suspect this could be improved? Should this be a parser/compile error? Thank you!