Changeset 13625


Ignore:
Timestamp:
10/10/11 20:56:39 (12 years ago)
Author:
ehuelsmann
Message:

More documentation of the Java FFI.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/doc/manual/abcl.tex

    r13624 r13625  
    260260% \end{itemize}
    261261
     262\subsubsection{Calling Java class static methods}
     263
     264Like with non-static methods, references to static methods can be acquired
     265by using the \code{JAVA:JMETHOD} primitive. In order to call this method,
     266it's not possible to use the \code{JAVA:JCALL} primitive however: there's a
     267separate API to retrieve a reference to static methods. This
     268primitive is called \code{JAVA:JSTATIC}.
     269
     270Like \code{JAVA:JCALL}, \code{JAVA:JSTATIC} supports dynamic dispatch by
     271passing the name of the method as a string instead of passing a method reference.
     272The parameter values should be values to pass in the function call instead of
     273a specification of classes for each parameter.
     274
    262275\subsubsection{Parameter matching for FFI dynamic dispatch}
    263276
    264277The algorithm used to resolve the best matching method given the name
    265278and the arguments' types is the same as described in the Java Language
    266 Specification. Any deviance should be reported as a bug.
     279Specification. Any deviation should be reported as a bug.
    267280
    268281% ###TODO reference to correct JLS section
     282
     283\subsubsection{Instantiating Java objects}
     284
     285Java objects can be instantiated (created) from Lisp by calling
     286a constructor from the class of the object to be created. The same way
     287\code{JAVA:JMETHOD} is used to acquire a method reference, the
     288\code{JAVA:JCONSTRUCTOR} primitive can be used to acquire a constructor
     289reference. It's arguments specify the types of arguments of the constructor
     290method the same way as with \code{JAVA:JMETHOD}.
     291
     292The constructor can't be passed to \code{JAVA:JCALL}, but instead should
     293be passed as an argument to \code{JAVA:JNEW}.
    269294
    270295\section{Lisp from Java}
Note: See TracChangeset for help on using the changeset viewer.