[I'm splitting this up, to make it easier to know what we're talking
about]

Chaim Frenkel <[EMAIL PROTECTED]> writes:

[...]

>       Reduce          (e.g. $x = reduce { sum } @list;

reduce needs to be able to take an (optional?) "distinguished element" 
to start from.  Consider this:

   reduce sum () == 0
   reduce times () == 1
   reduce catenate () == ''

Where do we get the right one from?

Worse, not every associative operation (I'd rather not go the abstract
nonsense way and start spouting monoids, if it's all the same with any
latent category theorists) has an identity, though I'm out of natural
examples.

Wouldn't it be more useful, though, to have the linguistic framework
to write map, reduce, multimap, sort, and friends, and then provide
them in a "standard library" (aka "modules", if you prefer)?  Perl5
almost has it, I think.

   reduce operation list
   map operation list
   multimap operation list-of-lists     # uurgh.

[...]

-- 
Ariel Scolnicov        |"GCAAGAATTGAACTGTAG"            | [EMAIL PROTECTED]
Compugen Ltd.          |Tel: +972-2-6795059 (Jerusalem) \ We recycle all our Hz
72 Pinhas Rosen St.    |Tel: +972-3-7658514 (Main office)`---------------------
Tel-Aviv 69512, ISRAEL |Fax: +972-3-7658555    http://3w.compugen.co.il/~ariels

Reply via email to