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

Re: The meaning of "returns"

Thread Previous | Thread Next
July 28, 2005 06:52
Re: The meaning of "returns"
Message ID:
HaloO Autrijus,

you wrote:
>>  D) Make the return type observe both #2 and #3 at compile time,
>>     using type variables:
>>        sub id ( (::T) $x ) returns ::T { return($x) }
> And this is a natural extension to guide the inferencer so it won't be
> totally giving up on polymorphic functions such as &id.  C) and D) can
> be taken together, resulting to a powerful soft typed language.

This is my preference. The only known issue with parametric typing is
the proliferation of params as soon as you want to stay away from

> However, if we take the view that type annotation are merely storage
> allocation hints and runtime coercers, then A) is probably the way to go.

Please no. Or at least not exclusively. I see your "storage allocation
hints" as a data environment needed to implement the type.
$TSa.greeting := "HaloO"; # mind the echo!

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