develooper Front page | perl.perl6.users | Postings from July 2021

Re: Why does .new initialize?

Thread Previous | Thread Next
Peter Scott
July 19, 2021 17:00
Re: Why does .new initialize?
Message ID:
On 7/19/2021 1:24 AM, Elizabeth Mattijsen wrote:
> If .new wouldn't initialize a type to its basic instantiation, what would be the point of .new then?
> FWIW, the same goes for:
>      dd;      # 0
>      dd;      # 0e0
>      dd;  # <0+0i>
>      dd;      # ""
> If you want to leave it undefined, don't call .new on it?
> *confused*

Only that there's a vocal school of thought in O-O that says new() 
should only allocate memory and never put anything in there.  Now I know 
that Raku doesn't subscribe to that I have no problem.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About