From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18437 invoked by alias); 17 Sep 2017 23:17:59 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 18421 invoked by uid 89); 17 Sep 2017 23:17:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=jar, Protocol X-HELO: aibo.runbox.com Received: from aibo.runbox.com (HELO aibo.runbox.com) (91.220.196.211) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 17 Sep 2017 23:17:48 +0000 Received: from [10.9.9.211] (helo=mailfront11.runbox.com) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1dtior-0004Sf-JX; Mon, 18 Sep 2017 01:17:45 +0200 Received: from 70-36-239-177.dsl.dynamic.fusionbroadband.com ([70.36.239.177] helo=localhost.localdomain) by mailfront11.runbox.com with esmtpsa (uid:757155 ) (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.82) id 1dtioZ-0001K3-KR; Mon, 18 Sep 2017 01:17:27 +0200 Subject: Re: Environment Introspection To: Peter , kawa@sourceware.org References: <87lgldyrg8.fsf@nexoid.at> From: Per Bothner Message-ID: <1222b13d-969b-d59f-4808-280199b140bc@bothner.com> Date: Sun, 17 Sep 2017 23:17:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <87lgldyrg8.fsf@nexoid.at> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-q3/txt/msg00058.txt.bz2 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/