[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: strange table index "end"
- From: Steve Litt <slitt@...>
- Date: Wed, 9 Mar 2011 10:46:37 -0500
On Wednesday 09 March 2011 09:27:16 Jeff Pohlmeyer wrote:
> On Wed, Mar 9, 2011 at 8:06 AM, Steve Litt wrote:
> > This is the first surprising behavior I've ever seen in Lua.
> > I would have expected it to know that mytable.end is a table
> > element whose name happens to be "end".
>
> Doesn't work in Lua:
>
> rec={}
> rec.do=1
>
> '<name>' expected near 'do'
>
>
> Doesn't work in C:
>
> typedef struct rec {
> int do;
> };
>
> error: expected identifier or '(' before 'do'
>
>
> Doesn't work in Pascal:
>
> type rec=record
> do: integer;
> end;
>
> Fatal: Syntax error, "identifier" expected but "DO" found
>
>
> - Jeff
:-)
I've always expected the unexpected in C, Pascal, Perl and the like.
SteveT
Steve Litt
Recession Relief Package
http://www.recession-relief.US
Twitter: http://www.twitter.com/stevelitt