pyret-lang
pyret-lang copied to clipboard
Any good reason to disallow identifiers beginning with digit?
Also identifiers starting with hyphen. These would be great for naming the results of algebraic operations, such as
2x = 2 * x
-y = 0 - y
Both of those are super misleading as “just” identifiers in algebra notation, and are things a student or teacher might write expecting an operation to happen.
I think this is a good nudge to give special error messages for those cases!
I agree. If we make these identifiers work, teachers will expect all kinds of things to "just work", especially the math teachers: if I write
x = 2
y = 4
2xy
is that 16?
There are a handful of times in Racket where I make use of this, and it's true that I do miss it in Pyret in those situations. But the likelihood of confusion/misconceptions, especially with one of our major audiences (programming-unsophisticated middle-school math teachers) is far, far greater and more important.
Agreed. I think we should close as WontFix, but I don't think I have the authority to do that
Agreed. Filing under “just because we can, don't”