There's actually at least three topics here, as near as I can tell.

1) What operations on an array give a result which has row(s) removed.

2) What operations on a variable give a result which has row(s) removed.

3) What operations free the memory occupied row(s).

I think the discussion so far has covered topic (1) rather well. I
would mention however, that triple nested indices can be used to
delete a row from an array:

   (<<<2) { i.4 4
 0  1  2  3
 4  5  6  7
12 13 14 15

This is the same result as 1 1 0 1 # i.4 4 and is the same result as
0 1 3 { i.4 4.

For topic (2) you have to update the variable using =: (with some
obscure exceptions involving OS interactions),

For topic (3) you have to get rid of all references to the old array.
The reason is J as a language acts like it's making copies of the
array when the array is being used as an argument. But, behind the
scenes, it's really just using reference counts. (And, perhaps I
should mention that reference counts do not work very well in some
other languages with different semantics from J. So if you are
familiar with the literature, you might feel uncomfortable with this
approach. But you should also beware of alternate solutions which need
problems that you do not have.)

I hope this helps,


--
Raul

On Tue, May 19, 2020 at 11:04 AM Skip Cave <[email protected]> wrote:
>
> Use copy (#) or from ({)
>
>
> tst
>
> ┌──────┬──────┐
>
> │May 08│May 07│
>
> ├──────┼──────┤
>
> │2020 │2020 │
>
> ├──────┼──────┤
>
> │664.35│652.35│
>
> ├──────┼──────┤
>
> │660.21│653.00│
>
> ├──────┼──────┤
>
> │664.56│657.12│
>
> ├──────┼──────┤
>
> │657.67│651.29│
>
> ├──────┼──────┤
>
> │- │- │
>
> ├──────┼──────┤
>
> │1.84% │1.19% │
>
> └──────┴──────┘
>
> 0 0 1 1 1 1 1 0#tst
>
> ┌──────┬──────┐
>
> │664.35│652.35│
>
> ├──────┼──────┤
>
> │660.21│653.00│
>
> ├──────┼──────┤
>
> │664.56│657.12│
>
> ├──────┼──────┤
>
> │657.67│651.29│
>
> ├──────┼──────┤
>
> │- │- │
>
> └──────┴──────┘
>
>
> or
>
> 2 3 4 5 6{tst
>
> ┌──────┬──────┐
>
> │664.35│652.35│
>
> ├──────┼──────┤
>
> │660.21│653.00│
>
> ├──────┼──────┤
>
> │664.56│657.12│
>
> ├──────┼──────┤
>
> │657.67│651.29│
>
> ├──────┼──────┤
>
> │- │- │
>
> └──────┴──────┘
>
>
> Skip Cave
>
>
>
> On Tue, May 19, 2020 at 8:36 AM Michael Dykman <[email protected]> wrote:
>
> > I have also found {:: to be very useful and under appreciated.
> >
> >
> >
> >
> > On Tue, May 19, 2020, 07:56 HH PackRat <[email protected]> wrote:
> >
> > > On 5/19/20, Michael Dykman <[email protected]> wrote:
> > > > In functional languages, you don't really delete so much as you make a
> > > > fresh copy absent of the undesirable elements.
> > > > Where you looking for this?
> > > >
> > > >  ] a=. <"0 'abcdef'
> > > > ┌─┬─┬─┬─┬─┬─┐
> > > > │a│b│c│d│e│f│
> > > > └─┴─┴─┴─┴─┴─┘
> > > >    0 0 1 1 0 1 # a
> > > > ┌─┬─┬─┐
> > > > │c│d│f│
> > > > └─┴─┴─┘
> > >
> > > That kind of thing is what gave me the idea of a boolean mask of some
> > > type.  However, can this be carried over, applying to rows of a table
> > > instead?  I'm thinking that it probably does in some way, but I want
> > > confirmation on that.  Thanks for your response!
> > >
> > > 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

Reply via email to