[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua function syntax sugar for a digit started function name?
- From: Dirk Laurie <dirk.laurie@...>
- Date: Thu, 19 Apr 2012 16:16:23 +0200
> Lua 5.1.4
>
> For example:
>>
>> bar = {}
>> bar.name = 'test'
>> bar['123.com'] = function(self) print(self.name) end
>
> I can't call the method like below:
>>
>> bar:['123.com']()
>> stdin:1: '<name>' expected near '['
>
This has nothing to do with function names. The tbl.xxx and tbl:xxx
syntax sugar
is available only when xxx is an alphabetic key.