[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: How to use custom __index in LuaJava?
- From: Jonas Bengtsson <jonas.b@...>
- Date: Tue, 16 Jan 2007 23:23:34 +0000
Hi y'all!
Consider these two use cases:
1) For some classes I want to support 'method calls' which are not part
of the class, e.g. so you can write obj.foo instead of obj:getFoo() and
obj.foo = bar instead of obj:setFoo(bar).
2) When a script is trying to access a global that doesn't exist I'd
like to dynamically provide some value from some hash table in java land.
How would you normally solve those problems in LuaJava? In vanilla Lua I
guess it would involve metatables, and __index/__newindex.
Also, is LuaJava 1.1 far from release?
Cheers,
Jonas