lua-users home
lua-l archive

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


I agree this could be done that way and actually didn't suggest any
implementation, but: 

- token filter isn't yet part of standard lua
- even if token filter would, maybe it could be worth having some
  agreement on commonly filtered token, at the risk of having big
trouble to
  integrate code (although lua isn't generally used with the idea of
  integrating third part code)
- once a level of agreement is reached, couldn't we debate on what can
be
  standard syntax vs token filtered syntax ? And eventually put ':' back
to
  token filter level (not sure it is possible...) ?

Anyway I also didn't consider the case self:method() versus
self.method(). And I was surprise to see this comment about this
particular syntax being one of the very first remarks from a ruby user.
I forwarded it because I admit that I can easily get used to it,
although that may discourage to use locals....
function C:f()
  self.r = self.x * 2 + self.y / self:g()
end
function C:f()
  @r = @x * 2 + @y / @g()
end

-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Luiz Henrique
de Figueiredo
Sent: Thursday, March 15, 2007 1:07 PM
To: Lua list
Subject: Re: Colon Operator: Superfluous Syntax?

> By the way, couldn't we add a ruby like syntax sugar '@' for self.? 

You can do it yourself with token filters.