3 ms·
I think you're confusing "keyword" with "reserved word". A keyword has a special meaning in certain circumstances, while a reserved word cannot be used as an id
by kupiakos 8y ago
I think you're confusing "keyword" with "reserved word". A keyword has a special meaning in certain circumstances, while a reserved word cannot be used as an identifier. In some languages, those are the same thing.
For example, "goto" is a reserved word in Java, while not a keyword. Inversely, in Fortran, keywords are not reserved names, so `if if then then else else` is valid. C# has "keywords" and "contextual keywords", both categories being keywords, but only the former being reserved names.
Regardless, a builtin might be referring to a function that's included as part of the base language - like make() in Golang or zip() in Python.
- vanderZwan 8y agoEh, right. But correcting for that I still hold the same view that adding new builtins should be considered breaking backwards compatibility. EDIT: Since someone has gone through the trouble of downvoting this viewpoint, I would like an explanation as to why I'm wrong here. I cannot imagine a scenario in which doing so would not likely break existing code.
- mrgriffin 8y agoIf you allow shadowing then surely the local definition of the name will take precedence over the new name introduced in the stdlib (or wherever), and thus the program will keep behaving how it did before the new builtin was introduced. I think I must be misreading you, because it sounds like you're arguing for the idea that adding new names to an API should be considered a breaking change? I'll accept that maybe reflection will catch those changes, but with that exception why would any code even notice?
- deleted 8y ago[deleted]