home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / perl / 7425 < prev    next >
Encoding:
Text File  |  1992-12-14  |  1.1 KB  |  32 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!sybus.sybus.com!myrddin!tct!chip
  3. From: chip@tct.com (Chip Salzenberg)
  4. Subject: Re: In 5.0, are we gonna get...
  5. Message-ID: <2B2D2498.874E@tct.com>
  6. Date: Tue, 15 Dec 1992 00:19:36 GMT
  7. References: <1992Dec14.043835.23009@reed.edu> <1992Dec14.192007.7534@wdl.loral.com>
  8. Organization: TC Telemanagement, Clearwater, FL
  9. Lines: 21
  10.  
  11. According to mab@wdl39.wdl.loral.com (Mark A Biggar):
  12. >Larry has talked about adding a 'reduce' operator that calls a special
  13. >sort like function (used $a,$b for arg passing) on each element of a
  14. >list for doing summations like so:
  15. >
  16. >    $sum = reduce {$a+$b} 1,34,$x,45,-8,0.1;
  17.  
  18. Interesting.  That operation would be a generalization of join:
  19.  
  20.     $x = join(":", @foo);
  21.  
  22. and
  23.  
  24.         $x = reduce {$a.":".$b} @foo;
  25.  
  26. would be equivalent (though join would probably be much faster).
  27. -- 
  28. Chip Salzenberg at Teltronics/TCT  <chip@tct.com>, <73717.366@compuserve.com>
  29.   "you make me want to break the laws of time and space / you make me
  30.    want to eat pork / you make me want to staple bagles to my face /
  31.    and remove them with a pitchfork" -- Weird Al Yankovic, "You Make Me"
  32.