Nathan Wiger writes:
: Now, it may be that all the "We should use ." people are just keeping
: quiet, or think it's obvious why this is a benefit, but I'm unconvinced.
: Again, I'm open-minded, but the only argument I've really heard is to
: make Perl more Java/Python-like. This doesn't sway me at all. Are there
: other reasons?

Yes, there are, but I don't really want to write Apocalypse 12 before
I finish Apocalypse 2.  However, I can tell you that object attributes
will likely be declared as special variables within a class like this:

    my $.foo;
    my @.bar;
    my %.baz;

and henceforth be usable as either methods or as data values (but the
latter only within the object methods of the class).  It is also a
distinct possibility that unary . will be used to indicate methods called
on the current object.  This would avoid both the problems of trying
to come up with an agreed-upon name for $self/$this/self/me/whatever,
but also avoid the problem of C++ where a method call is not visually
distinguished from a function call.

Anyway, I wish you folks would stop arguing about heroic measures to
rescue the . operator for concatenation.  It's not going to happen.
I want people to associate .foo with the idea of methods and attributes
about the way they associate $foo with scalars currently.  This won't
happen if we overload it, and I'm pretty picky when it comes to the
psychology of the thing.

And I'm tired of hearing the argument that Perl programmers can't get
used to a different operator for concatenation.  I know better--after
all, Perl is probably what got them used to . in the first place.  If
you can teach dogs to salivate at a bell, you can probably teach them
to salivate at a dog biscuit.  :-)

Larry

Reply via email to