On Sat, Nov 29, 2003 at 12:53:50PM -0800, Paul Hodges wrote:
: 
: --- Larry Wall <[EMAIL PROTECTED]> wrote:
: > On Sat, Nov 29, 2003 at 08:50:57AM -0800, Paul Hodges wrote:
: > : hmm... lexical properties....I've read the rest of the message,
: > : and I see how this could be a problem. Just to be clear on it,
: > : what exactly would it mean for a property or trait to be lexical?
: > : If a value or container with that aspect gets passed out of that
: > : scope, what happens?
: > 
: > It would mean that that aspect becomes unnameable, even if a
: > different lexical name looks like it.  (But note that exportation
: > can cause two distinct lexical scopes to share the same name.)
: 
: To quote a better man than me, "ow, me noggin."
: Do you mean unreference-able by name?
: And "exportation"???

Exportation is just aliasing some name inside a scope to somewhere
outside the scope.  Importatation is the same operation from the viewpoint
of the importing scope.

Perl 5 didn't allow exportation of lexicals because typeglobs only dealt
with package variables, not lexical variables.  In Perl 6 we'll be able
to alias both lexicals and package variables.  That implies that a lexically
scoped name can be exported, whether it refers to a variable or something
else like a property.

: > : Wouldn't an object efectively provide a virtual "scope" of its own?
: > 
: > Depends on what you mean by effective.  There's a sense in which the
: > object knows nothing about the properties that are going to be bound
: > to it someday, or whether there might be two conflicting properties
: > of the same name.  There is the danger of ad hoc polymorphism.
: 
: Don't you just love the way the Greek "polymorphism" just comfortably
: sidles up to the literal Latin "ad hoc"? :)  Almost makes me feel like
: I was back in college, staying up way too late talking about the nature
: of reality, except that this is both more "concrete", if you will, and
: usually more confusing, lol.

Well, I didn't make up that particular term.  It's right out of the OO faq.

: What I mean is (I guess) that there should only be one $o.bar, and it
: sounds like you're saying that's not the case. Please fix my bleeding
: brain on this one?

It means if there are two conflicting definitions of the same name, it's
considered ambiguous where both versions of name are visible.  Otherwise,
the name means the property that is in scope, and you can't see the "other"
property that happens to have the same name elsewhere.  In other words,
any time you say property "bar", it's really a shorthand for a longer
name that may include a package name or lexical scope.  The aliasing of
the short name to the actual name has to be unambiguous or it's illegal.

Larry

Reply via email to