Maybe along these lines?

   -/i.5 NB. Right fold
2
   (((0-1)-2)-3)-4 NB. Left fold
_10
   (-~)/|.i.5
_10

   ((((0-1)-2)-3)-4)-5
_15
   (-~)/|.i.6
_15

   %/>:i.5 NB. Right fold
1.875
   (%~)/|.>:i.5 NB. Left fold
0.0083333333
   (((1%2)%3)%4)%5
0.0083333333



On 11/16/07, metaperl.j <[EMAIL PROTECTED]> wrote:
>
>
> Folding and unfolding are staples of functional programming. Insert
> approximates fold-left, but what approximates fold-right?
>
> --
> View this message in context:
> http://www.nabble.com/Where-is-right-fold-in-J--tf4824111s24193.html#a13802283
> Sent from the J General mailing list archive at Nabble.com.
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



-- 
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to