[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaJava Utilities
- From: Rolf Ehrenreich Thorup <rolft@...>
- Date: Thu, 14 Aug 2008 19:55:50 +0200
steve donovan wrote:
This is a small Lua for Windows plugin that adds LuaJava plus some
interesting utilities. Just unzip into the LfW main directory, so that
things like luaj.exe sit next to lua.exe, etc. (If you don't use LfW,
then it should be straightforward anyway; the source is included)
The `import` function works like the Java statement of the same name,
so that import 'java.lang.*' means that things like String, Integer,
etc will be brought into the global namespace. As an extra
convenience, when classes are imported, a `__call` metamethod is
defined, so that you can simply create objects by calling the types,
> require 'java.import'
> import 'java.lang.*'
> s = String("hello")
Looks great! Much more convenient than the all these exhausting calls to
bindClass and new.