Re: RFC 171 (v2) my Dog $spot should call a constructor implicitly

[email protected] (Hildo Biersma)
Newsgroups perl.perl6.language.objects
Organization Morgan Stanley Dean Witter & Co.
Message-ID <[email protected]>
Perl6 RFC Librarian wrote:
>> =head1 DESCRIPTION
> 
> What is currently an optimization for pseudo-hashes:
> 
>     my Dog $spot = Dog->new();
> 
> should be replaced with:
> 
>     my Dog $spot;
> 
> which calls an implicit constructor (discussed further in the IMPLEMENTATION
> section).  The optimization behaviour can be retained in some form (see the
> MIGRATION section).

My previous concerns have not been adressed:
- There may not be a default constructor
- This makes creations of Singleton classes impossible
- There is a good reason to created typed, but undef, references
  and fill them in later.

> For example, the syntax:
> 
>     my Dog $spot = "Spot";
> 
> would be transformed to, or be the equivalent of:
> 
>     $spot = Dog->$METHOD("Spot");

Based on my C++ experience, this should only be allowed if the
constructor has been marked as 'implicit construction safe'.

Hildo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.