Oleg raises a good point. y=. will not overwrite MASTER, because
when the use count of the data area is greater than 1, the assignment
cannot be in-place and Roger will copy the data area. So y =. doesn't
really gain anything here, and my warning can be rescinded.
If you took this out and coded it inline, you would want to make sure
you got the in-place assignment.
Something I have long wanted: could
y =. x f`g`]} y
[or (f`g`]}) if that helps] use in-place assignment? If so, could
y =. x name y
where name is defined as f`g`]} also use in-place assignment? There
are several doodads I use that require f`g`]} and as it is now, if they
apply to big arrays and I really need the in-place assignment, I can't
have a defined verb to do the job - I have to code the f and g inline.
Henry Rich
Oleg Kobchenko wrote:
> Yes, Henry expanded the definition of the form X u‘v‘w } Y and conjunction u
> &: v.
>
> You could also assign out further, 0{"1 y etc.
>
> Will y=. overwrite MASTER?
>
>
> On Dec 18, 2008, at 20:10, Henry Rich <[email protected]> wrote:
>
> 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
>
>
>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm