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

Re: reduce metaoperator

Thread Previous | Thread Next
From:
Uri Guttman
Date:
May 4, 2005 06:19
Subject:
Re: reduce metaoperator
Message ID:
x7br7rnn7t.fsf@mail.sysarch.com
>>>>> "LW" == Larry Wall <larry@wall.org> writes:

  LW> I propose that reduce become a metaoperator that can be applied to
  LW> any binary operator and turns it syntactically into a list operator.
  LW> I am currently thinking that the metaoperator is a prefix spelled \\
  LW> (though there are certainly lots of other possibilities that I've laid
  LW> awake all night thinking about).  There are the usual suspects like:

  LW>     $sum = \\+ @array;
  LW>     $fact = \\* 1..$num;

shouldn't that be s/fact/prod/ ? sure the input makes it a factorial but
the general case would be a product. not that what var names you choose
matters but i think it would be clearer if used as a real example in
some future docs.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org

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