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

RE: Semantics of vector operations (Damian)

Thread Previous | Thread Next
From:
Austin Hastings
Date:
January 22, 2004 10:23
Subject:
RE: Semantics of vector operations (Damian)
Message ID:
ICELKKFHGNOHCNCCCBKFMEKDCJAA.Austin_Hastings@Yahoo.com


> -----Original Message-----
> From: Jonathan Scott Duff [mailto:duff@lighthouse.tamucc.edu]
> Sent: Thursday, January 22, 2004 1:16 PM
> To: Austin Hastings
> Cc: Larry Wall; Language List
> Subject: Re: Semantics of vector operations (Damian)
>
>
> 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.

It would be disappointing if junctions could not be lvalues.

> > 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.

I'm curious if that's true, of if they're two different ways of getting to
the same data. (At least in the one-dimension case.)

=Austin


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