X

Sundararajan's Weblog

  • Java
    October 12, 2006

No reserved words!

Guest Author

Came across Rémi Forax's blog entry titled
Languages Evolution: introduction of new keywords. He proposes the idea of contextual keywords. i.e., keywords can be used as identifier in other places - which helps in introducing new keywords in a mature language - without breaking existing programs. I've renamed "enum" during JDK 5.0. I've seen others renaming of "assert" during 1.4. So, how about avoiding renaming - but, still have new (context sensitive) keywords....

Now, that reminds me of PL/I - no reserved words! PL/I's "keywords" are recognized only in context, and may otherwise be used as identifier elsewhere. I've never programmed in PL/I. My friend (who used to be a mainframe programmer) used to "scare" us by showing programs such as this one.

Interestingly, Smalltalk does not have reserved words at all. Sometimes it is said that Smalltalk has only 5 reserved words:

  1. nil (null)
  2. true
  3. false
  4. self (this)
  5. super

But, it is possible to create methods even with these names!

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.