Timeline for Why was nil defined as a reserved word in Pascal?
Current License: CC BY-SA 4.0
4 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 12, 2018 at 16:38 | comment | added | Leo B. | @JeanPierre That's right; the last paragraph of @Jules answer echoes what I meant ("...it has to be a keyword, otherwise things will get messy"). My second point is that if you want to disallow NIL@ in the compiler, then doing it at the syntax level by making NIL a keyword is much easier than doing it at the semantic level. It is hard to day now if this consideration has influenced the design choice, but as Pascal was a teaching tool, Wirth must have heard the question "What happens if you dereference NIL?" enough times to take care of it in the compiler. | |
| May 12, 2018 at 7:40 | comment | added | JeanPierre | About you first point, it could be assigned a "special type", but I think you mean it's simpler to consider it a keyword; see my comment on @Jules' answer. Your second point is very interesting; what makes you think it is a reason for making this design choice and not a consequence of the choice? | |
| May 10, 2018 at 5:48 | history | edited | Leo B. | CC BY-SA 4.0 | added 242 characters in body |
| May 7, 2018 at 11:07 | history | answered | Leo B. | CC BY-SA 4.0 |