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

Re: Adding linear interpolation to an array

Thread Previous
Dave Whipp
March 8, 2005 09:31
Re: Adding linear interpolation to an array
Message ID:
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 )


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