NB. update only selected items from y with monad
function of y, leave rest unchanged.
upfltr =: 4 : 0
NB. update filtered y. x updateV`fltrV,
'`up f' =. x
(up (I. f y){ y) (I. f y) } y
)
NB. double items greater than 10:
+:`(10&>) upfltr 5 9 11 12
10 18 11 12
is there a faster way to implement the above? Seems
to me the above verb should be one of the built-in
gerund ammend options, (maybe it is, and I just don't
understand the documentation for it).
Btw, the documentation of amend should be much more
accessible, or include additional simpler examples of
common data updates.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm