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

Re: construction clarification

Thread Previous | Thread Next
Damian Conway
June 1, 2005 06:10
Re: construction clarification
Message ID:
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.


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