Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

__init vs. __init_pmc

0 views
Skip to first unread message

Leopold Toetsch

unread,
Jan 24, 2007, 4:46:35 PM1/24/07
to perl6-i...@perl.org
Hi,

some changes not too long before the release did break pg.t. I was now able to
track it down:

now the object constructor:

$I0 = find_type ['Pg';'Conn']
o_con = new $I0, con

does _not_ call

.sub init :vtable :method

anymore

it's calling init_pmc instead.

This change is just adding more mess to object construction and argument
passing.

I've made several attempts to unify object construction with new calling convs
but no one seems to be listening :-(

leo

Matt Diephouse

unread,
Jan 25, 2007, 12:23:23 AM1/25/07
to Leopold Toetsch, perl6-i...@perl.org

That was a change I made (with Allison's approval). The purpose of the
change was to eliminate differences between PMCs and objects. It's confusing
for PMCs and objects and objects that subclass PMCs to behave differently.
Given that PMCs can have two different init functions, how does it make
sense for objects to have only one? Does providing an init function for a
subclass of a PMC override both of the parent's init functions?

--
Matt Diephouse
http://matt.diephouse.com

Leopold Toetsch

unread,
Jan 25, 2007, 1:52:08 PM1/25/07
to ma...@diephouse.com, perl6-i...@perl.org
Am Donnerstag, 25. Januar 2007 06:23 schrieb Matt Diephouse:
> > This change is just adding more mess to object construction and argument
> > passing.
> >
> > I've made several attempts to unify object construction with new calling
> > convs
> > but no one seems to be listening :-(
>
> That was a change I made (with Allison's approval). The purpose of the
> change was to eliminate differences between PMCs and objects. It's
> confusing for PMCs and objects and objects that subclass PMCs to behave
> differently. Given that PMCs can have two different init functions, how
> does it make sense for objects to have only one? Does providing an init
> function for a subclass of a PMC override both of the parent's init
> functions?

The differences were confusing. More so are they now. All the C<new> variants
are confusing. I've proposed to use Parrot calling conventions to pass args
and just call one method for object creation, e.g. in

http://groups.google.at/group/perl.perl6.internals/browse_frm/thread/e68dc0a0a96585b7/076502809495f8e2?lnk=st&q=parrot+instantiate+toetsch&rnum=5#076502809495f8e2

leo

0 new messages