|
From: Jeff H. <je...@Ac...> - 2006-05-02 00:13:27
|
Neil Madden wrote:
> Jeff Hobbs wrote:
> > The idea is to have it interp-wide, where TCL_PKG_THRESHOLD (if set) =
> > would be seeded (one-time) into each interpreter on creation. If =
you=20
> > think it will cause problems, then don't use it. It is intended to =
be=20
> > a power-user, watch foot and gun type of feature.
>=20
> Well, my primary concern is that other packages may use it without me=20
> knowing, and so affect how [package require] works for me. For =
instance,=20
> if I [package require foo] and foo somewhere does [package threshold=20
> alpha], then my subsequent [package require]s may get alpha versions=20
> where I was expecting stable versions. So even if I don't use the=20
> feature it may still affect my code.
OK, I am now beginning to understand the concern. The 'package =
threshold' is
not intended to be used by module authors (in the same way that =
tcl_precision
should not have been). That's of course a loose directive, not =
something that
can be enforced.
> BTW, another alternative that lies somewhere in between the two=20
> approaches would be to let [package threshold] take a block of code =
and=20
> set the threshold just for the duration of that code block, i.e.:
>=20
> package threshold alpha {
> package require foo 1.0
> package require bar 2.1
> }
But this is equivalent to:
package require foo 1.0a0
package require bar 2.1a0
and remove the 'a0' when you no longer want allow alpha code. The use =
of the
package threshold is more meta (and thus intended for the script =
author). We
are talking about installations with lots of packages, where you may =
well have
10 versions of a package installed of various quality levels. When you =
make
use of TMs and have other means for managing large repos of extensions, =
the
need for this meta level of control becomes more apparent (and least, =
the
belief in that need ;) ).
Jeff
|