Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
abcl
abcl
Commits
6e3c85a6
Commit
6e3c85a6
authored
Oct 10, 2011
by
ehuelsmann@1c010e3e-69d0-11dd-93a8-456734b0d56f
Browse files
More documentation of the Java FFI.
parent
7022b1d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
doc/manual/abcl.tex
View file @
6e3c85a6
...
...
@@ -259,14 +259,39 @@ operator.
% classpath at runtime (JAVA:ADD-TO-CLASSPATH).
% \end{itemize}
\subsubsection
{
Calling Java class static methods
}
Like with non
-
static methods, references to static methods can be acquired
by using the
\code
{
JAVA:JMETHOD
}
primitive. In order to call this method,
it's not possible to use the
\code
{
JAVA:JCALL
}
primitive however: there's a
separate API to retrieve a reference to static methods. This
primitive is called
\code
{
JAVA:JSTATIC
}
.
Like
\code
{
JAVA:JCALL
}
,
\code
{
JAVA:JSTATIC
}
supports dynamic dispatch by
passing the name of the method as a string instead of passing a method reference.
The parameter values should be values to pass in the function call instead of
a specification of classes for each parameter.
\subsubsection
{
Parameter matching for FFI dynamic dispatch
}
The algorithm used to resolve the best matching method given the name
and the arguments' types is the same as described in the Java Language
Specification. Any devia
nce
should be reported as a bug.
Specification. Any devia
tion
should be reported as a bug.
% ###TODO reference to correct JLS section
\subsubsection
{
Instantiating Java objects
}
Java objects can be instantiated
(
created
)
from Lisp by calling
a constructor from the class of the object to be created. The same way
\code
{
JAVA:JMETHOD
}
is used to acquire a method reference, the
\code
{
JAVA:JCONSTRUCTOR
}
primitive can be used to acquire a constructor
reference. It's arguments specify the types of arguments of the constructor
method the same way as with
\code
{
JAVA:JMETHOD
}
.
The constructor can't be passed to
\code
{
JAVA:JCALL
}
, but instead should
be passed as an argument to
\code
{
JAVA:JNEW
}
.
\section
{
Lisp from Java
}
In order to access the Lisp world from Java, one needs to be aware
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment