(a -> b) -> T a -> T b
T (a -> b) -> T a -> T b
(a -> T b) -> T a -> T b echo@> (2{ARGV) -.&([: <;._1 LF, 1!:1) (3{ARGV)
NB. 2nd arg 3rd arg
NB. g&f execute f for each, then g on both
NB. 1!:1 read file
NB. LF, prepend newline
NB. [: <;._1 split based on first char
NB. -. remove right elements from left array
NB. echo@> echo each line
exit 0
On two ~1.6MB files with ~15k lines (both the same except 3) I had lying around: $ time j9 -c ./pseudo_grep.ijs test_b test_a
…
real 0m0.064s
user 0m0.032s
sys 0m0.017s
$ time grep -vf test_b test_a
…
real 0m5.815s
user 0m5.234s
sys 0m0.576s
Note that most of the script is for loading each file into an array of lines. Most work is done by -. on the two arrays, which is exactly what you asked for, e.g. 0 1 2 3 4 -. 2 4 is 0 1 3. https://code.jsoftware.com/wiki/Vocabulary/minusdot#dyadic // p={(x0,y0),(x1,y1),...} and v={(vx0,vy0),(vx1,vy1),...}
for(int j=0;j<2*SIZE;j++)p[j]+=v[j];
vs. // pv={(x0,y0,vx0,vy0),(x1,y1,vx1,vy1),...}
for(int j=0;j<4*SIZE;j+=4)
pv[i+0]+=pv[i+2],pv[i+1]+=pv[i+3]; LABEL = sys._getframe().f_lineno
print(1)
j(LABEL)