lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, Mar 9, 2011 at 08:01, Axel Kittenberger <axkibe@gmail.com> wrote:
> 2011/3/9 Pierre-Yves Gérardy <pygy79@gmail.com>:
>> On Wed, Mar 9, 2011 at 15:27, Leo Razoumov <slonik.az@gmail.com> wrote:
>>> Out of curiosity, are there languages around that allow keyword tokens
>>> to be used as variables, strings, etc ?
>>
>> Io doesn't have any keywords. See http://iolanguage.com/about/simplicity/ .
>
> In my opininion, operators should be added to this, there is not much
> difference for a key*word* and any special character combination in
> regards to language completexity. Everything that the lexer counts as
> one token and has a special meaning should be considered a key*word*.
> e.g. "~=", ";", "++", etc. This character combinations make things
> easy to read in some contexts but harder in others. I've seen too many
> suggestions lately trying to some special new operators combinations
> just to avoid adding a new "keyword", as it would be much difference.
>
>

There is some validity to this reasoning though: adding a new keyword
risks conflicting with variable names in existing code. If we add a
new keyword "foo", all the code that has a variable named foo is going
to break, but if we add a new operator "++", we don't have to worry
about some code having a variable named ++, as it's not a legal name.

(Not arguing we should add the ++ operator... just an example! :) )

-- 
Sent from my toaster.