First off, I think everyone is reading this RFC with the wrong mindset,
forgetting the concept of embedded objects in Perl 6.

I believe the idea would be that CREATE is a *fundamental* method, like
DESTROY, that would do basic declaration, creation, allocation, etc. So:

   my Dog $spot;
   print ref $spot;    # 'Dog'
   $spot = new Dalmation;

No reason this wouldn't still work. The term 'constructor' here is
misleading. 'creator' is what I prefer, and that's also why I prefer
CREATE.

> > My previous concerns have not been adressed:
> > - There may not be a default constructor

UNIVERSAL::CREATE would be the SUPER creator for all scalars in Perl 6,
at least as I see it. So the "fatal error" that Michael mentions would
never be raised.

> > - This makes creations of Singleton classes impossible

Not true, see above.

> > - There is a good reason to created typed, but undef, references
> >   and fill them in later.

Agreed, and CREATE does this.
 
>   - Makes factory methods impossible.

A little clarification on what specifically constitutes a "factory
method" would be great.

>   - Conveniently forgets all about polymorphism.

Again, not true. It better not!

At least, this is my take on it. CREATE would border right on the edge
of internals, taking care of stuff that you normally wouldn't handle
with new() anyways. Since it's a sub, you can put whatever you want into
it, but CREATE != new() philosophically.

And of course, Me != Michael, so I don't want to put too many words in
his RFC. However, this is my take on it. I'm writing a massive RFC right
now that tries to tie this all together. It's actually quite coherent,
but when little bits and pieces are leaked admittedly it sounds
disjointed.

Michael, if I'm missing your idea, don't let me mislead everyone...

-Nate

Reply via email to