lua-users home
lua-l archive

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


On Fri, Apr 25, 2014 at 2:38 AM, steve donovan
<steve.j.donovan@gmail.com> wrote:

> Perhaps because I grew up with Pascal, I've always thought keywords
> were sacred words. I usually get around this one by prefixing an
> underscore (_end) or title-casing (End).  I don't think the language
> needs to be distorted to allow conventions from other languages to be
> imported (begin/end iterators)

Well, strongly disagree. :\  I think it's pretty obvious 'end' is not
being used as a keyword if it appears as some_table.end.  Yes, I can
_prefix but it still feels like an unnecessary constraint on the
identifier used in that table.index sugar.  I also wish punctuation
could appear in a Lua identifier from the 2nd character onward.

I know you to be a very smart/clever guy but I want to shake my head
when it feels like you are against incorporating any concept that may
be best known from another language.

I'd want ? in identifiers so I could use it for methods returning
booleans (not "coerce to boolean").  I like the convention Ruby has:

some_table:do_something!() -- modifies some_table
some_table:do_something() -- copies some_table and modifies the returned copy
some_table:empty?() -- returns a boolean

Especially on that last one, I think it's clearer than writing an
is_empty() and later having to write 'if not some_table:is_empty()
then ...'  just sounds ~off~

Anyway, i'm off topic now :-)  If anything, allowing 'end' and similar
keywords used with the table.member syntax doesn't sound like a big
re-engineering effort.