[armedbear-devel] Question about calling Java

dmiles@users.sourceforge.net logicmoo at gmail.com
Thu Feb 4 14:54:19 UTC 2010

On Thu, Feb 4, 2010 at 6:39 AM, Axel Rauschmayer <axel at rauschma.de> wrote:

> Quick comment: The latest incarnation of the Java FFI API allows one to use
> strings whenever a class object or a method object is required:
> (jnew "my.package.MyClass" arg) for new my.package.MyClass(arg)

Something nice is the (jnew "my.package.MyClass" arg)  is going to be close
to what one day will be emitted bytecode wise.

> (jcall "methodName" obj arg) for obj.methodName(arg)

Then with this one as (jcall "pckgname.ClassOfArg" "methodName" obj arg)
will be close to bytecoded form
[I am not suggesting doing it right now since to *always* do it loses
expressablity of code]

> This is certainly good enough for me. I don't know how efficient the
> produced code is, but this is currently not an issue for me.

So do not be afraid of strings since that technically that is what will be
emmited into classfile bytecode (later on) :)

Note: if someone uses (jcall (jmethod "plgname.ClassOfArg"  "methodName")
obj arg)
  would could emit the invokevitual "plgname.ClassOfArg"  "methodName" obj
[args]; into bytecode
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/armedbear-devel/attachments/20100204/7c1f0fa2/attachment.html>

More information about the armedbear-devel mailing list