public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Per Bothner <per@bothner.com>
To: Peter <craven@gmx.net>, kawa@sourceware.org
Subject: Re: Environment Introspection
Date: Sun, 17 Sep 2017 23:17:00 -0000	[thread overview]
Message-ID: <1222b13d-969b-d59f-4808-280199b140bc@bothner.com> (raw)
In-Reply-To: <87lgldyrg8.fsf@nexoid.at>

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/

  reply	other threads:[~2017-09-17 23:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-17 20:57 Peter
2017-09-17 23:17 ` Per Bothner [this message]
2017-09-18  5:44   ` Peter
2017-09-18  6:15     ` Per Bothner
2017-09-20  7:05     ` Helmut Eller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1222b13d-969b-d59f-4808-280199b140bc@bothner.com \
    --to=per@bothner.com \
    --cc=craven@gmx.net \
    --cc=kawa@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).