Hi!

        Is there any possibility to discuss operators from apocalypse 3?

        Here goes my thoughts:

        1) ?: operator is very common to C programmers and should not be
       changed to ??::. I agree that the ':' can be usefull out there,
       but, if we change ?: to ()?: or ()?():()... I think this would
       be better...

        2) using ^ for mapping operators.. this only works with two lists.
           The problem here is that we have a pair of lists, and want a
           list of pairs. There can be other situations where we have
           three lists, instead of a list of tripplets... I thought it was
           better to have a 'evidence' or 'factorize' for lists in a way
       ((a,b,c),(1,2,3)) will become ((a,1),(b,2),(c,3)) and
           ((1,2,3),(4,5,6),(7,8,9)) will become ((1,4,7),(2,5,8),(3,6,9)).
           This way, the ^ operator could be replaced with a simple map...
           More generic, less operators confusion... better? maybe...

        3) Last, operator:+ and operator:* functions should receive two
           or more operands, or, implement a funcion like 'reduce' that
       with a binary operator, a neutral element and a list, reduces
           the list:

                sum(@a) should be   reduce(operator:+,0,@a)
        mul(@a) should be   reduce(operator:*,1,@a)

           Of course, this can be usefull for many other thing... think
           in list concatenation:

            concat(\@a,\@b,\@c) can be: reduce(\&concat,[],\@a,\@b,\@c)...

           Can this be usefull? I think, it could...


        Only my 5 cents... 

        Cheers ;)

        Alberto
-- 
 | Alberto Manuel Brandão Simões |
 | [EMAIL PROTECTED] |
 | http://numexp.sourceforge.net |

Reply via email to