[Openmcl-devel] Package-local nicknames

Tim Bradshaw tfb at tfeb.org
Wed Feb 6 07:28:24 PST 2013

On 6 Feb 2013, at 14:25, Josh Marchán wrote:
> A while back, I started playing with the idea on CCL and added it to 3b's
> package-local-nicknames library. It's certainly not complete and it's an
> awful hack, but it's a nice proof-of-concept:
> https://github.com/sykopomp/package-local-nicknames

For what it's worth I think the right thing to add right now is not package-local-nicknames but a standard mechanism of hooking name->package lookup on which can be built anything you like.   The traditional way of doing this is to redefine FIND-PACKAGE, but that does not work for all implementations (including CCL).  If we could get everyone to agree that *any* name->package lookup checks (I am making this up as I go) *FIND-PACKAGE-HOOK* and if it is non-nil calls it with the name of the package, expecting two values: 

	a package and T meaning use this
	nil and T meaning nothing found, and do not call the default function
	nil and nil meaning nothing found and call the default function.

*FIND-PACKAGE-HOOK* should be bound to NIL during the call, so the hook can call FIND-PACKAGE without fear (which it will very often want to do).

I have no idea what package *FIND-PACKAGE-HOOK* should be in.

Once something like that exists then you can build any user-level thing you like on it.

More information about the Openmcl-devel mailing list