[self-interest] simplicity

Toby Ovod-Everett toby at ovod-everett.org
Tue Jun 29 15:18:55 UTC 2004

On Tue, Jun 29, 2004 at 06:30:23AM -0700, Ned Konz wrote:
> On Sunday 27 June 2004 10:54 pm, Toby Ovod-Everett wrote:
> > I wonder if this is a New Jersey vs. MIT school of thought thing.  As a
> > programmer, I deal with enough weirdness in the environment, without
> > wanting to worry about weirdness in my language.
> Then why did you write (and use?) Class::Prototyped for Perl <g>?

Because I like programming in Perl, but I needed access to the semantics of
Self. :)

> An explanation for the rest of you on the list:
> Toby is the author of a Self-like object model for Perl. This is a module 
> that's available on CPAN and lets you combine regular old Perl 5 (either 
> without objects, or using Perl's simple object model) with slot-based 
> prototypes.
> Since he may be the only user of this module, I should let him explain how it 
> works in practice.

Ned and I engaged in much deep Perl wizardry in order to get C::P to actually
work.  It is a bit frightening that it does.  But in the interests of this
discussion, I should state that a good portion of the test suite is devoted to
ensuring that object finalization a) occurs at the proper time and place and
b) happens in the proper order.  This is a bit trickier that it may seem,
because an object may inherit its destroy method from a parent object, and
that parent object may exist only because the child object has a reference to
it.  It is important during the child object's destruction that the reference
be held on to until the very end of the destruction process so that the child
is not trying to call a destroy method that has disappeared . . .

> In the interests of full disclosure, I have to say that I helped writing 
> Class::Prototyped, but I didn't inhale. And I quit working with Perl a long 
> time ago.

I think you inhaled deeply for at least one extended weekend :)

--Toby Ovod-Everett

More information about the Self-interest mailing list