Re: use & imports
Miles Egan <[email protected]> 17 Apr 2003 14:48:39 -0700
| Newsgroups | gmane.comp.lang.goo.general |
|---|---|
| Message-ID | <[email protected]> |
--=-GNgLg9qNMwTNwDaEnvAb Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Cool. I'll take a look at this. On Thu, 2003-04-17 at 14:29, Andrew Sutherland wrote: > Miles Egan <[email protected]> writes: >=20 > > Is there any way to use a module without dumping all of its exports int= o > > the local namespace? Generally I prefer to use explicit namespace > > prefixes. > >=20 > > miles >=20 > A while back I added use/mangle. Assuming it hasn't gone away, my > original post still holds. I think that provides what you want. It > goes a little something like this: >=20 > ----- >=20 > Anonymous CVS (see info at Wiki) now has use/mangle support checked > in. This is relevant for those of you who want to do things like: >=20 > (use/mangle tests/manglea a:) > (use/mangle tests/mangleb b:) >=20 > (a:func-a) > (a:func-b) > (b:func-a) > (b:func-b) >=20 > All it does is import everything exported by the module in question, > but with the given prefix mangled on to the binding name. >=20 > For those who were desiring module:binding, this is equivalent to what > you wanted, although it's usable for other things too. For example, > you could also bind on "mail-" instead, or something like that. >=20 > This should help deal with the instinct of prefixing method names > yourself, out of a fear of name collisions. (Eg, earlier I found > myself prefixing "mail-" onto functions just because I was concerned > about binding collisions with something more important.) Note that I > am one of those people would ideally like a unified generic system > without the constraints on the number of parameters, but this is a > useful thing regardless, and very helpful in the short term. >=20 > ----- >=20 > Andrew --=20 Miles Egan <[email protected]> --=-GNgLg9qNMwTNwDaEnvAb Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQA+nyE3U4Jq/wH1PVERArp2AJkBrbeLK2ZN6K10lqUjY2yoR+IICACeJddW IdVeh1AMIXA/2wOOKzyagxQ= =ZD/Y -----END PGP SIGNATURE----- --=-GNgLg9qNMwTNwDaEnvAb--