update =: 4 : 0
updrows =. (0 {"1 y) i. (0 {"1 x)
y =. x updrows} y
)Don't take out the y =. Henry Rich Hahn, Harvey wrote: > On 13 Apr 2008, Oleg Kobchenko posted > <http://www.jsoftware.com/pipermail/programming/2008-April/010462.html> > the following tacit expression as the solution to a question I had: > > NEW [`(i.&:(0&{"1)~)`] } MASTER > > Essentially, this fills in missing rows of table "NEW" with rows from > table "MASTER" (or, expressed differently, overlay the table "MASTER" > with the table "NEW"). Additionally, an error message results if table > "NEW" contains a (first-column) key not in table "MASTER". > > Tacit expressions (particularly as solutions to problems) seem to be > nearly second nature to many people in this forum. However, being still > a newbie when it comes to J programming, I don't completely understand > exactly what's happening in Oleg's tacit expression above. (I > understand a bit here and there--emphasis on "bit"--but, as a whole, it > eludes me in terms of where I'm at in my learning.) Can Oleg or > somebody else translate it into an equivalent dyadic verb containing a > multi-line explicit definition without using any tacit expressions? > (I'm not looking for a different way of accomplishing the same thing; > for comparative learning purposes, I'd really like an explicit version > of Oleg's tacit expression above.) This particular function is > extremely important for some of my applications, and I need to be able > to do some step-by-step tracking (for example, with smoutput) of what's > happening with some new and different data. > > I would really appreciate this! Thanks in advance! > > Harvey > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
