On Fri, Jun 29, 2001 at 09:50:55AM -0400, Dan Sugalski wrote:
> At 10:32 PM 6/28/2001 -0400, Michael G Schwern wrote:
> >The rule of thumb has always been if you can do it in a module, don't
> >put it in the core.  Well, we can do it in a module.  Work on the
> >module, don't complicate the core.
> 
> Doing it properly in a module is significantly more of a pain than doing it 
> in the core.

I've already done it, it was easy.  Adding in an object-based
inheritance system should be just as easy, I just need an interface.
$obj->parents(@other_objs) is a little clunky.


> Faking it with a module means a fair amount of (reasonably slow)
> perl code

Nope, it just uses Perl's own object/class system.  Look at
Class::Object!  Its really, really thin.  Benchmark it, its no slower
than regular objects.
http://www.pobox.com/~schwern/src/Class-Object-0.01.tar.gz


> Besides, there are languages that do this on a per-object basis all the 
> time anyway (aren't there? I think there are) in which case it makes sense 
> to yank it into the core interpreter, as it'll be supporting more than just 
> perl.

*buzzzz* false logic.  If you can do something via a core module, it
is supported by Perl.  Or does Perl not do CGI, web stuff, databases,
etc...?

Anyhow, Self is the only one I can think of.  ALL THE FULL-TIME SELF
PROGRAMMERS HERE, PLEASE RAISE THEIR HANDS! ;)

Like I said, classless OO is interesting and sometimes useful, but not
terribly so.  I'd find it much more useful to put something like
object delegation ($obj->foo translates to $obj->{other_obj}->foo) and
Self-style 'slots' ($obj->foo translates to $obj->{foo}) into the
core.  Doing THOSE sorts of things outside of the core are a
performance drag.


-- 
Michael G Schwern   <[EMAIL PROTECTED]>   http://www.pobox.com/~schwern/
Perl6 Quality Assurance     <[EMAIL PROTECTED]>       Kwalitee Is Job One

Reply via email to