lua-users home
lua-l archive

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


Thank you, how can I "fix" that in pure lua?

On Sun, Oct 25, 2009 at 5:16 PM, GrayFace <sergroj@mail.ru> wrote:
Because tables have their own metatables, there's may not be global metatable for all tables. Same for full userdata. Dunno about lightweights.








----- Original Message ----- From: Fernando P. García
To: Lua list
Sent: Monday, October 26, 2009 4:12 AM

Subject: Re: Metatables, C and Script...


All 'obj:method' calls must pass 'obj' as the first parameter to function, no metter what type 'obj' is. So it's extremely wierd if it doesn't. I haven't tried this on objects, but it works well with strings and numbers. Maybe I couldn't understand what your problem is.

I'm curious about why following does not works:

Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
t={'a','a'}
print(t:concat())
stdin:1: attempt to call method 'concat' (a nil value)
stack traceback:
  stdin:1: in main chunk
  [C]: ?



Blessings!
--
Fernando P. García, http://www.develcuy.com
Developer - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Perú

** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de tí.




--
Fernando P. García, http://www.develcuy.com
Developer - Analista de Sistemas
+51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco -Perú

** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de tí.