A collection of descriptions of internals.
A copy of the Java class hierarchy is (lazily) maintained in the Lisp address space.
A class struct is a plist (all supertypes, classes and interfaces, will be present if a class is preset):
(:name java.util.ArrayList
:superclass java.util.AbstractList
:interfaces (java.io.Serializable
java.lang.Cloneable
java.lang.Iterable
java.util.Collection
java.util.List
java.util.RandomAccess)
:methods methodList
:fields fieldList
:modifiers (public super))
A class struct is generated by the function gg--get-class-struct
which takes a class symbol as an argument.
A method is a plist (TODO put modifiers here):
(:name currentThread
:returns java.util.Thread
:accepts nil
:modifiers (static))
(:name contains
:returns boolean
:accepts (java.lang.Object)
:modifiers nil)
A field is a plist:
(:name name
:type java.lang.String)
In C code, a Java object is represented by a pointer. When objects
are returned from C code, they are wrapped as Lisp structures by
calling gg--new-object
. When we say “Java object”, we are
generally referring to a Lisp-wrapped version of the object. When we
say raw object, we are referring to the List representation of the
pointer.
Functions ending with -raw
accept raw objects as arguments. All
others accept Java objects.
c.f. gg-objectp
- Run Emacs under
gdb
(using theemacs_debug
script) - Load/start Emacs Gargoyle (done automatically by
gg_debug.el
) - Load the ert tests (and call
eval-buffer
) - Run them (call
ert
)
- raw object - a List
userptr
of a Cjobject
.