On Tue, May 08, 2001 at 08:21:10PM -0500, David L. Nicol wrote:
> What if, instead of cramming everything into "scalar" to the point
> where it loses its value as "a data type that magically converts
> between numeric and string, as needed," we undo the Great Perl5
> Dilution and undecorate references.

There are two very important reasons why $%@ is more than just YA
Hungarian Notation.  I believe Abigail pointed this out to me some
time ago.

The first, string interpolation.  $ lets Perl be fairly unique in
having a simple way to interpolate variables in strings.  Its a fairly
clear distinction between a bare word and a variable.

With the idea of interpolating method calls in strings on the table,
it now becomes rather important to have that $ on objects.

        print "The $animal.name says: $animal.sound\n";

Of course, we could disambiguate by requiring the () as class methods
will...

        print "The animal.name() says: animal.sound()\n";

But that leads to the second Very Important Reason.  Distinguishing
between object method and class methods.  In the above example, it is
not clear if you're calling the method 'name' on the class 'animal' or
on the object 'animal'.  

The inevitable clash will happen where a variable name will match that
of a class name and no simple rule can solve it.  Object methods
cannot have precedence over class methods else there becomes no way no
call that class method.

I'm sure some set of special, optional disambiguating syntax (similar
to ${var}) could be dragged in, but it seems like you're just trading
one bit of inconsistency for another.

-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl6 Quality Assurance     <[EMAIL PROTECTED]>       Kwalitee Is Job One
If you have to shoot, shoot!  Don't talk.
                -- Tuco, "The Good, The Bad And The Ugly"

Reply via email to