> Couldn't:
>    my $u = User.new('abw', 'Andy Wardley', '[EMAIL PROTECTED]');
> just be
>    my $u = User->new('abw', 'Andy Wardley', '[EMAIL PROTECTED]');
> 
> And:
>    $foo.bar.baz = 10;
> Just be:
>    $foo::bar::baz = 10;

Yes, but the semantics change.  A key feature of this proposal is that
object/class variable and methods are indistinguishable to the user.
The dot operator does the right thing to call a method (if defined), 
or instead access a variable, or follow a delegation reference, etc.
i.e. 
    $foo.bar

is something like (assuming a blessed hash)

    UNIVERSAL::can($foo, 'bar') ? $foo->bar() : $foo->{'bar'};

'->' and '::' won't do that, and shouldn't.  If we tried to overload 
'::' or '->' to be more magical then we would break things all over 
the place.

> There are also tons of methods of inheritance in Perl's existing object
> and package structure as-is, through SUPER, CORE, and many other
> methods.

Yes, there's nothing that you can't already do in Perl in one way or 
another.  Perl 5's OO is very elegantly bolted onto the side of the 
language.  It's very powerful, flexible and reasonable easy to use.
On the other hand, you sometimes have to jump through lots of hoops
to do some very simple OO stuff that in other OO langugages is taken
for granted.  

> If you just want to tighten up certain aspects of packaging and
> classing, it seems like this could be done with a pragma or a couple new
> keywords, instead of redoing the entire package structure of Perl, which
> I quite like.

No, I don't want to tighten up anything about Perl's existing package
and blessed reference system.  It's fine the way it is.  I *ALSO* 
want a more formally defined OO system for times when I'm feeling more 
structured, or when the scale or scope of the project I'm working on 
demans it.  This should definately, absolutely, without doubt be an 
"as well as" option and not "instead of".  Hence the new kind of package, 
and the new kind of operator, rather than messing around with the old ones.


A

Reply via email to