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

Re: Adding linear interpolation to an array

Thread Previous
From:
Dave Whipp
Date:
March 8, 2005 09:31
Subject:
Re: Adding linear interpolation to an array
Message ID:
20050308173144.17958.qmail@lists.develooper.com
Thomas Sandlaß wrote:

>> Or perhaps even
>>
>> sub foo (Num @in is copy does LinearInterpolation)
>> {
>>    ...
>> }
> 
> 
> This is my big questionmark on roles: is the above a contraint
> or merely a directive. In the former case only Arrays of Num that
> do LinearInterpolation are allowed, in the latter case every
> Array of Num that is used as argument gets the role attached while
> it lingers in foo.

Perhaps a new keyword/opertor is need to separate the constraints from 
the directives. C<that> would read nicely:

   sub foo ( Num @in is copy that does LinearInterpolation )

Dave.

Thread Previous


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