Possibly relevant StackOverflow question:

"Why does constraining a Perl 6 named parameter to a definite value make it
a required value?"
https://stackoverflow.com/questions/48166325/why-does-constraining-a-perl-6-named-parameter-to-a-definite-value-make-it-a-req

On Mon, Jul 19, 2021 at 10:00 AM Peter Scott <pe...@psdt.com> wrote:

> 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 Int.new;      # 0
> >      dd Num.new;      # 0e0
> >      dd Complex.new;  # <0+0i>
> >      dd Str.new;      # ""
> >
> > 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.
>
> Cheers,
> Peter
>

Reply via email to