[Jprogramming] monad vs. dyad

Geoff Canyon geoffc at inspiredlogic.com
Wed Mar 21 22:22:56 HKT 2007


Thanks -- this was very puzzling until I realized (a little bit of)  
what was going on. From my tests it seems that it's always safe to  
cap the fork, so I can do this:

f=:[: <"0 (>:i.7)*] NB. note the 7 instead of the 6

and it will work. So whenever I'm using a mondadic verb I should cap  
it to be on the safe side, even if I think it will have an odd number  
of arguments. Would you agree?

regards

Geoff

On Mar 20, 2007, at 8:14 AM, Mark D. Niemiec wrote:

> If you want to use a monadic verb within a fork, or train of forks,
> rather than using a hook, you should use a capped fork ([: a b)
>
>    f=:[: <"0 (>:i.6)*]
>    f 26
> +--+--+--+---+---+---+
> |26|52|78|104|130|156|
> +--+--+--+---+---+---+



More information about the Programming mailing list