On Tue, Oct 18, 2005 at 07:38:19PM -0400, Stevan Little wrote:
: Then this is added as "Dog-0.0.2-cpan:LWALL" into the main symbol  
: table. Then once the compilation process is complete, I traverse the  
: symbol table hierarchy collecting all the names. Any duplicate short  
: names (Dog) are noted for later. Once I have collected all the names,  
: I build all my aliases.
: 
: So if I find:
: 
:   use Cat-0.0.1-cpan:JRANDOM;
: 
: only once, I build an alias for (at a minimum) "Cat" and "Cat-0.0.1".  

But you have to have the aliases there for correct parsing.  Otherwise
"Cat" is a bareword, which is illegal. Of course, you can add the
alias without deciding what to bind it to.  In fact, within a method,
we require "Cat" to be considered a virtual name, so if a derived
class uses a different Cat, it means that one instead for this object.

: For my duplicates, the table would look something like this I think:
: 
:   Dog       => Dog-1.2.1-cpan:JRANDOM
:   Dog-1.2.1 => Dog-1.2.1-cpan:JRANDOM
:   Dog-0.0.2 => Dog-0.0.2-cpan:LWALL
: 
: We are explictly giving the preference to the later version number (I  
: think we discussed this at the Toronto hackathon).

Hmm, don't remember that.  But I have a bad memory.

: Another school of thought would be that "Dog" alone would be  
: considered ambiguious and so we would just alias far enough to be  
: clear, like this:
: 
:   Dog       => Ambiguity Error!
:   Dog-1.2.1 => Dog-1.2.1-cpan:JRANDOM
:   Dog-0.0.2 => Dog-0.0.2-cpan:LWALL
: 
: Of course, this means that if I also load "Dog-1.2.1-cpan:LWALL" that  
: the table looks like this:
: 
:   Dog       => Ambiguity Error!
:   Dog-1.2.1 => Ambiguity Error!
:   Dog-0.0.2 => Dog-0.0.2-cpan:LWALL
: 
: And the user is now forced to add the cpan id to get Dog-1.2.1. I am  
: not sure how strict @Larry wants this to be.

I think $Larry wants to be strict on this, at least this week.  If you're
using two different versions explicitly within the same scope, you should
probably be required to alias one of them.  The main purpose of version
co-existence is for different modules to use different versions, not
the same module.  I think using two different versions from the same
module is going to be relatively rare.

Larry

Reply via email to