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

Re: Parameter and trait questions - just how 'only' _is_ 'read-only'?

Thread Previous | Thread Next
From:
Luke Palmer
Date:
March 30, 2005 13:37
Subject:
Re: Parameter and trait questions - just how 'only' _is_ 'read-only'?
Message ID:
20050330213949.GA301@navi.cx
Thomas SandlaƟ writes:
> Aaron Sherman wrote:
> >No, that was most of the point. &foo did not declare a return type, and
> >while my code was simplistic, we obviously cannot be certain what &foo
> >might return in the general case.
> 
> Sorry that I've spoiled that. But I wonder if it's just in the
> examples here on the list or a general laxity to not specify a return
> type of subs and methods. 

It depends on the programmer.  I'm sure that you and probably Aaron will
always declare your return types.  I'm quite sure that I will not except
for when it effects a semantic that I want.

Ultimately, it depends on how Perl 5-ish you want to program Perl 6 in
this regard.  I definitely enjoy Perl 5's late binding for the most
part.  Again, I usually only resort to early binding things (like type
declarations and sub prototypes) when it changes the semantics in some
way.

Luke

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