develooper Front page | perl.perl6.language | Postings from January 2004

Re: Semantics of vector operations (Damian)

Thread Previous | Thread Next
From:
Jonathan Scott Duff
Date:
January 22, 2004 11:04
Subject:
Re: Semantics of vector operations (Damian)
Message ID:
20040122181559.GC17679@lighthouse.tamucc.edu
On Thu, Jan 22, 2004 at 01:10:23PM -0500, Austin Hastings wrote:
> In reverse order:
> 
> >     %languageometer.values ?+= rand;
> 
> This is the same as
> 
>      all( %languageometer.values ) += rand;
> 
> right?

It's the same as 

	$r = rand;
	$_ += $r for %languageometer.values

Your junction looks like it should work but I think you're really
adding the random number to the junction, not the elements that compose
the junction thus none of %languageometer.values are modified.

> And is this
> 
> >     %languageometer.values ?+=? rand;
> 
> the same as
> 
>     all( %languageometer.values ) += one( rand );

I don't think so.  It's like:

	$_ += rand for %languageometer.values

perhaps if you had:

	$j |= rand for (0..%languageometer.values)
	any(%languageometer.values) += $j;

Though I'm not sure what that would mean.  

I don't think junctions apply at all in vectorization.   They seem to
be completely orthogonal.

-Scott
-- 
Jonathan Scott Duff
duff@lighthouse.tamucc.edu

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