Please VOTE! Changing keywords to functions
"Mark Hahn" <[email protected]> Mon, 26 Jul 2004 22:42:42 -0700
| Newsgroups | gmane.comp.lang.prothon.user |
|---|---|
| Message-ID | <000001c4739c$897fe810$0d01a8c0@MarkVaio> |
We have already changed "print" and "yield" from keywords to functions. Guido specifically mentioned "exec" so I will put that on my to-do list to change also. Greg's logic for changing "print" was that "there was no reason for it to be a keyword". Martin pointed out that functions can be overriden while keywords cannot. Both of these arguments can be applied to any keyword that doesn't include a code block with maybe these exceptions... The keyword "del" has a syntax problem if changed to a function. It's args would be evaluated instead of kept as l-values. The keyword "pass" should stay special since it generate no code. The three keywords: "break", "continue", and "return" have no reason to be treated special except that they are already keywords in a zillion different languages. Yield is now a function so why not return? It is really nice to be able to say break and continue without following it with parens though. The parser does treat return a bit special right now so if it wasn't a keyword I may get into trouble, but this could probably be fixed. That pretty much leaves this list as candidates for conversion... assert from import raise Please vote on which keywords you think should be changed to functions. I vote for adding exec, assert, from, import, and raise in addition to print and yield.