[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: How to write function x:y():f() ... end ?
- From: Carsten Fuchs <carsten.fuchs@...>
- Date: Tue, 26 Feb 2013 11:42:00 +0100
using Lua 5.1, I'm trying to define a method in a table that has been returned by a
previous method call, like this:
Unfortunately, this doesn't work: <name> or '...' expected near '"someObject"'
Alternatives that work are
x:y("someObject").f = function(self)
local someObject = x:y("someObject")
but these are also the only working variants that I have found, and was wondering if
there is a way to write this closer to the former one-line variant?
Dipl.-Inf. Carsten Fuchs
Carsten Fuchs Software
Industriegebiet 3, c/o Rofu, 55768 Hoppstädten-Weiersbach, Germany
Internet: http://www.cafu.de | E-Mail: email@example.com
Cafu - the open-source game and graphics engine for multiplayer 3D action