something x = y
for all values of something
other than global
, local
, and (top-scope) const
, is a parse error, so adding dynamic
or any other keyword there is already possible. global
/local
/const
could be context-dependent rather than lexer keywords. This would involve a token of lookahead, but that’s easy enough. They don’t happen to be, which is also fine, but means that if they became contextual, it wouldn’t invalidate any existing programs, you can’t have global = 5
, let alone global global = 5
. But these constructs could certainly be parsed if that was desired. It would be an unusual choice, but I kind of like it.
By contrast, having let
as a variable modifier would be undecidable in linear time, since let x = y
begins a let
block in Julia. You’d need to scan the entire program to count end
tokens and see if you came up short, for every let
, which is awful. I understand that you have a solution to this but don’t really care to relitigate that particular disagreement.