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

Re: Semantics of vector operations

Thread Previous | Thread Next
Uri Guttman
January 26, 2004 00:56
Re: Semantics of vector operations
Message ID:
>>>>> "JW" == John Williams <> writes:

  JW> On Fri, 23 Jan 2004, Larry Wall wrote:
  >> Sorry, I was just copying the designers of supercomputers in my
  >> terminology.  So you can really blame Seymour Cray for misappropriating
  >> the term.  On a Cray, "vector processing" is just operations applied
  >> in parallel to two one-dimensional lists.  Unfortunately, I don't
  >> think you'll be able to get an apology from Seymour Cray these days...

  JW> I just want to chime in to support dropping the term "vector".
  JW> There are enough people who speak both math and CS that I have
  JW> noticed a lot of confusion caused by the term, not only in the
  JW> "outer product" vs "inner product" vs what-we-really-mean, but
  JW> also with stopping at the max or min when working with unequal
  JW> length lists.

since the inputs are usually lists, why not call them list-ops?

so >>+<< is list-plus and takes a list (or array ref) on either side and
does a DWIM +. that is, element wise if two lists and a scalar added to
each element if only one list. AFAICT all list ops always generate lists
as a result (reduce is not a list op). 

  JW> I would vote for "element-wise" for a relatively accurate
  JW> description, or "hyper" for short, fun, and
  JW> not-implying-anything-specific description.

and >><< is the listifying op. it converts the op it surrounds into a
list form that will return a list value.

this is analogous to += being an assignment op. the key part is the list
result or the assignment and it is a modification of a regular scalar


Uri Guttman  ------  --------
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------

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