Re: [tcljava-dev] Patch: java::import -classpath -resolve
Brought to you by:
mdejong
|
From: Tom P. <tpo...@ny...> - 2003-04-14 21:07:13
|
On Mon, Apr 14, 2003 at 01:32:16PM -0700, Mo DeJong wrote:
> On Wed, 9 Apr 2003 08:39:10 -0600
> Tom Poindexter <tpo...@ny...> wrote:
>
> > On Wed, Apr 09, 2003 at 01:14:00AM -0700, Mo DeJong wrote:
> > > On Tue, 8 Apr 2003 22:07:41 -0600
> >
> > > I must admit, I don't like the idea of adding a -classpath option to the
> Sorry, I am going to have to reject this patch. I don't see how adding a path
> to the TCL_CLASSPATH is more "disturbing" than passing a flag to the
> import command.
This:
set cp /usr/local/lib/tcljava-1.3.0/hyde/pizza/pizza-1.1.jar
java::import -classpath $cp -package net.sf.pizzacompiler.compiler \
ByteArrayCompilerOutput \
ClassReader CompilerOutput Main MapSourceReader Report SourceReader
# do stuff with pizza classes
vs. this:
global env
if {[info exists env(TCL_CLASSPATH)]} {
set old_tcl_classpath $env(TCL_CLASSPATH)
}
set cp /usr/local/lib/tcljava-1.3.0/hyde/pizza/pizza-1.1.jar
lappend env(TCL_CLASSPATH) $cp
java::import ByteArrayCompilerOutput \
ClassReader CompilerOutput Main MapSourceReader Report SourceReader
# do stuff with pizza classes
# now put TCL_CLASSPATH back the same way we found it
if {[info exists old_tcl_classpath]} {
set env(TCL_CLASSPATH) $old_tcl_classpath
} else {
unset env(TCL_CLASSPATH)
}
you be the judge.
> Well, in that case perhaps the right fix is to always pass the extra resolve
> flag to the class loader. In any event, exposing this functionality as the
> script layer just does not sound like a good idea.
I'd argue that exposing more functionality *is* a good idea. The 'java'
package is already incredibly powerful - no need to add training wheels to
a hotrod.
--
Tom Poindexter
tpo...@ny...
http://www.nyx.net/~tpoindex/
|