Re: autos2j environment

"Alessandro Colomba" <[email protected]>
Newsgroups gmane.comp.java.sisc.user
Message-ID <[email protected]>
On 6/16/06, Matthias Radestock <[email protected]> wrote:
[...]
> One possible solution is to automatically bind all symbols with a
> certain prefix to the appropriate s2j java class, method or field. To
> the programmer this feels like having a toplevel environment in which
> all java entities are pre-defined. One would be able to write, for
> example
>
> (install-autos2j 'j%)
[...]
> Comments? Suggestions?
[...]

I think this is a very nifty approach. A few questions arise:

1. Would the effect of install-autos2j be limited to the some lexical
scope? It would be nice to be able to keep the chosen prefixes local
to a module, for instance.

2. Is there any way that something similar could be done with Java
package names? As in:

(import-java-package |java.lang| jl%)

(let ((buf (java-new <jl%string-buffer>)))
 ...

3. This is very minor, but what do you think of a name such as
(import-autos2j) or the like, since we are, in a sense, importing a
set of symbols from the outside?
___
Alessandro
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.