lua-users home
lua-l archive

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

Yes the same limitation as on any other use of :. But so far we have been useing : only with identifiers. While 

function_obj : msg()

claims to be a replacement for 

function_obj("msg", ...)

Semantically 'msg' is treated as a regular string... on one hand. On the other hand, it has to be a valid identifier token string. This means that those who might be interested in using this new feature in practice would be required to make sure that their messages are valid identifier tokens. 

With all it's limitations and peculiarities of [mis]use in some contexts I fail to see how Lua would benefit from this on one hand, while I also fail to see what is wrong with 

function_obj("msg", ... )

to begin with. The above form, while marginally longer to type, is clear to anyone and works for any string. 


-----Original Message-----
From: Rici Lake []
Sent: Wednesday, September 22, 2004 11:52 AM
To: Lua list
Subject: Re: Functional objects

On 22-Sep-04, at 1:48 PM, Bilyk, Alex wrote:

> So, basically per the proposal below the following would be equivalent 
> to one another
> print : hello

syntax error. Would have to be print:hello()

> print"hello"
> print("hello")
> It feels to me that the first one is somewhat counter intuitive. In 
> addition how would I use the first form to make it equivalent to

I agree, that is not the context in which I would use it.

> print(":)")
> print : :) -- ???
> If it doesn't than it is a severe limitation on what strings can be 
> used with it.

Yes, it can only be used with legitimate identifier tokens; the same 
limitation as in any other use of :