develooper Front page | perl.perl6.language | Postings from June 2005

Re: construction clarification

Thread Previous | Thread Next
From:
Damian Conway
Date:
June 1, 2005 06:10
Subject:
Re: construction clarification
Message ID:
429DB3C2.6050709@conway.org
Carl Franks wrote:

>>The universal new() would handle the one-argument call exactly the
>>same as your overloaded new() does.
> 
> 
> Is that correct? S12 says...
>   All classes inherit a default new constructor from Object.
>   It expects all arguments to be named parameters initializing
>   attributes of the same name.
> ... which seems to contradict.

Apologies. I hadn't noticed that you were intending to call it with a 
positional argument. In which case, yes, you would indeed require the separate 
constructor definition.

Damian

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About