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

Re: The meaning of "returns"

Thread Previous | Thread Next
From:
=?ISO-8859-1?Q?=22TSa_=28Thomas_Sandla=DF=29=22?=
Date:
July 28, 2005 06:52
Subject:
Re: The meaning of "returns"
Message ID:
42E8E329.5090206@orthogon.com
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
unpecificity.


> 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


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