This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Environment Introspection


On 09/17/2017 01:56 PM, Peter wrote:
Is there a way to enumerate all loaded modules / libraries /
environments? For things like finding out what I can "import"?

Not easily.  You can import just about any class in the CLASSPATH,
and I don't know of any direct way on the Java platform to enumerate all
the classes in the CLASSPATH.

It is possible to use the Java Debug Interface to return a list
of all loaded types (com.sun.jdi.VirtualMacine#loadedTypes).

It is possible to for each element in the CLASSPATH:
(1) if the element is a .jar you find the set of entries in the jar.
(2) if the element is a directory you find the .class files in
sub-directories.
(3) If the element is an ArrayClassLoader (used for Kawa dynamic classes),
search available classes
(4) otherwise skip the classloaader element.

This is a non-trivial job, of course.  It may be needed for tab-completion
but useful tab-completion should be possible without it.

I've seen gnu.mapping.Environment, is there a global list of existing
Environments anywhere?

No.

(This is for implementing a swank server for multiple Schemes,
to make them work with SLIME).

I think supporting the Language Server Protocol is most promising path for
IDE support (including on Emacs), but it's great if you can make Swank/Slime useful.

--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]