Getting out my snmail address lists for my Midwinter party I
needed to replace all occurrences of nulls with empty character
strings for conversion to csv files . While it might be old hat
for the old hands , I kinda like the fns I came up with and
think they are generally useful .
where : { + ( ^ x ) _vs & ,/ x }
where..h : " like & for rectangular boolean arrays "
This would seem the natural extension of & .
skatteramend : { ./[ x ; y ; :[; z ] ] }
skatteramend..h : " replaces items in x at addresses y with value z "
where :[; z ] is the construction presented by Steve Apter in
http://www.kx.com/listbox/k/msg03369.html .
Perhaps someone may suggest a pithier yet memorable name .
So , replacing all the _n in my mail list becomes :
skatteramend[ ML ; where ML ~\:\: _n ; "" ] / result returning
or
skatteramend[ `ML ; where ML ~\:\: _n ; "" ] / amend in place .
A more concrete example :
Q : 3 5 # ! 15 ; skatteramend[ Q ; where Q ! 2 ; -1 ]
( 0 -1 2 -1 4
-1 6 -1 8 -1
10 -1 12 -1 14 )
--
CoSy_MidWinter_Gathering 15
http://cosy.com/current.htm#20020204
--
Bob Armstrong --
http://CoSy.com -- 212-285-1864
http://CoSy.com/K/CoSy.htm : Rapid Quantitative Modeling
http://CoSy.com/Homes : Building Affordable Homes in NYC
2002/01/24 6:15:36 AM