> Also, its not entirely clear why method chaining is desired only for
> constructor and destructors. What about every other method?
Constructors and destructors are special. They're not about *doing*
something; they're about *being* (or not being) something.
A "doing" method *may* wish t
> Yes, welcome to the dirty, icky real world. Life sucks, people will
> write bad code, you will have to inherit from it. Sometimes you have
> to break a little encapsulation to make an omlet. I'd rather it was
> not so, but its better to accept it and deal than deny.
>
> Of
On Sun, Sep 03, 2000 at 11:35:53AM +1100, Damian Conway wrote:
>> If you can figure a way out of the dilema I proposed above, I suppose
>> this makes sense.
>
> Easy. Don't let File::Lock::Mac inherit from File::Lock. Have it *delegate*
> to File::Lock instead. See my forthcoming C RFC.
On Sat, Sep 02, 2000 at 03:18:06PM -0400, Mike Lambert wrote:
> In certain cases, like the one in which you
> proposed, you'd want to explicitly bypass the parent DESTROY.
>
> sub DESTROY {
> my $self = shift;
> $self->UNIVERSAL::DESTROY(@_);
> }
>
> would skip the automatic chaining because
On Sat, Sep 02, 2000 at 03:13:17AM -0700, Matt Youell wrote:
> What happens when the base classes' author finally fixes the problem
> you wrote around (and incidentally changes touchy implementation
> details in the base)? What happens someday when you can't see the
> implementation of the base c
> I'm still not totally convinced that its so horrid to make the
> File::LockAndKey DESTROY call $self->SUPER::DESTROY manually...
Believe me, it is in a large, deep, and/or MI hierarchy!
> but it does break encapsulation.
Exactly.
> If you can figure a way out of the dilema I
> I can most certainly think of cases where a base class's DESTROY does
> something a derived class doesn't like. Consider your example,
> File::Lock. File::Lock::DESTROY calls flock($fh, LOCK_UN). I derive
> File::Lock::Mac from File::Lock. Uh oh, Macs don't implement flock!
> Under your prop
>The whole notion of blessing is non-obvious enough already.
It's the benedictory (con)not(at)ion of blessing, not the bless()ing
itself that so confuses people, I think.
It bless() were instead named something like
mark
stamp
label
brand
retype
denote
notate
On 9/2/00 11:34 AM, Nathan Wiger wrote:
> It doesn't seem that it's that hard to add a single line to your SETUP or
> BLESS or whatever method that calls SUPER::SETUP.
I'm pretty sure one of the big points about the system described is that it
ensures both that there's always a predictable and au
Michael G Schwern wrote:
>
> Derived classes will never have to override a base's implementation,
> and all member variables should be private, and everyone will always
> use an accessor, and the UN will bring about world peace, and as long
> as I'm wishing for a perfect world, I'd like a pony. ;
On Sat, Sep 02, 2000 at 12:16:48AM -0400, John Tobey wrote:
> I agree with Michael that SETUP should be BLESS. You argue that it
Oops, I mean Nate. Sorry, Michael!
-John
> goes? Your logic suggests that I'd never want to meddle in the base's
> implementation.
What happens when the base classes' author finally fixes the problem you
wrote around (and incidentally changes touchy implementation details in the
base)? What happens someday when you can't see the implem
On Sat, Sep 02, 2000 at 11:05:23AM +1100, Damian Conway wrote:
>> This bothers me. It leaves no way to override the behavior of a
>> parent's SETUP and DESTROY, you can only overlay. You mentioned that
>> this is normal for most other OO languages, so I presume there's a way
>> t
On Fri, Sep 01, 2000 at 08:59:10PM -, Perl6 RFC Librarian wrote:
> =head1 ABSTRACT
>
> This RFC proposes a new special method called C that is
> invoked automagically whenever an object is created. Furthermore,
> it proposes that both C and C methods should
> be invoked hierarchically in all
> =head2 Hierarchical C calls
>
> It is proposed that when an object is blessed, I of the C methods
> in any of its base classes are also called, and passed the argument list
> appended to the invocation of C. C methods would be called
> in depth-first, left-most order (i.e. ancestral C methods w
> > Furthermore, it proposes that both C and C methods
> > should be invoked hierarchically in all base classes.
>
> This bothers me. It leaves no way to override the behavior of a
> parent's SETUP and DESTROY, you can only overlay. You mentioned that
> this is normal for most
On Fri, Sep 01, 2000 at 08:59:10PM -, Perl6 RFC Librarian wrote:
> Furthermore, it proposes that both C and C methods
> should be invoked hierarchically in all base classes.
This bothers me. It leaves no way to override the behavior of a
parent's SETUP and DESTROY, you can only overlay. You
On 9/1/00 5:44 PM, Nathan Wiger wrote:
>> sub SETUP {
>> my ($self, @ctor_data) = @_;
>> # initialization of object referred to by $self occurs here
>> }
>
> Hmmm. I'm not sure if I like this. I like the *idea* a lot, but I must
> say that I think I quite like RFC 171's approach better.
I haven'
> The typical constructor would then be reduced to:
>
> package MyClass;
>
> sub new { bless {}, @_ }
>
> with initialization handled in a separate C routine:
>
> sub SETUP {
> my ($self, @ctor_data) = @_;
> # initialization of object ref
19 matches
Mail list logo