Hi Alex,

> BTW, how can I access existing objects (like "java.lang.System.err")
> in wl? I can only find 'jnew', which creates new objects.

Like this:

   (jfield `(jclass "java.lang.System") 'err)

There are some useful functions defined in java.wl file, implemented in
picolisp instead of in native java.  Basically, because Java objects are
first class citizens in the wl interpreter, I need very little special
purpose native functions and the rest can be build on top of that in
picolisp.

> It is just that I've put much more stress on execution speed, as I
> possibly want to use ErsatzLisp in real applications (e.g. Android
> apps) if I find the time.

Well, to be pedantic in regards to speed optimisations, whenever you do
something class specific you perform a class lookup based on the class
name passed in: e.g.

   (java "javax.swing.JFrame" T "Animation")

or

   (interface "java.awt.event.MouseListener" ...

In wl, there is no need for this because I can do this at read-time,
like the above example:

   `(jclass "java.lang.System")

Also, I can do it only once, see the 'import' function and how it is
used in swing.l and swt.l.

Cheers,

Tomas
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to