I've been experimenting with the new fold conjunction F:.  .   I think it's a 
very useful addition to J and thank all those who have made this  possible.   
Nevertheless I have some comments/reactions.    These are made in a 
constructive spirit.   Perhaps  these comments just display my own ignorance 
and J ineptitude.   I make these comments as someone who has worked in Kalman 
filtering and smoothing which seem perfect candidates for  Fold.   In fact I 
implemented Kalman filtering with F:. and found a dramatic increase in both 
computational speed and ease of coding, and a drastic reduction in J code 
clutter. 

0)   Is the monadic case useful?     To my mind it just creates potential  
confusion and "clutter":   most iterations can be thought of as an initial 
condition (x) with iterations which  consume y.    
1)   Why have Fold forward AND Fold reverse.    Can't you  just have Fold 
forward leaving the reverse to be treated as (u F:. v |.)   I realise this 
assumes the dyadic case  (see 0)
2)   When you type u F:. v into the interpreter I  get a whole lot of "code" 
rather than the usual boxed representation.    Is this intentional?   
3)  I made the comment in a previous post that the switching of x an y between 
(u F:. v) and v is very confusing to me.   It just doesn't seem natural.  The x 
in x (u F:. v) y is the natural "initial condition".   In each iteration the 
"natural" initial condition is the output of the previous iteration and I 
suspect most people would think this way.
4)  Is F.. really useful?   Why can't users just implement {:@(u F:. v), 
picking off the last result.   
5) The documentation section "which primitive should I use",  refers to F:...  
-- I don't understand what the three dots stand for.  Nor do I understand what 
eg "Fold Multiple *" means (ie the *).
6)  The documentation section "Common uses" part 1, gives, according to me a 
confusing and perhaps non constructive example.   The y  (from the point of 
view of u F:. v ) sequence is not used at all other than being printed out (as 
the x of v).      Perhaps a more instructive  example would be iteration of the 
form z_t=1/z_{t-1} + y_t.
implemented as  (]F:.((%@[+])~)).   (As per 3 I really dislike having to use ~)
7)  Somewhere in the documentation it states that "The first application of v 
consumes 2 items of y."    If I understand things correctly this is only true 
for the monadic case. 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to