Re: [Jprogramming] unmatched parenthesis

2016-12-28 Thread bill lam
just an idea (untested) using iterations 1. starting from left (or right as Linda) 2. find the first (innermost) matched pair 3. eliminate the pair 4. repeat from 1 until no more match. rremaining parentheses are umatched ones. On 28 Dec, 2016 12:54 pm, "Raul Miller" wrote: > I'm not sure if i

Re: [Jprogramming] u} vs m}

2016-12-28 Thread David Koppenhoefer
Thank you - following this discussion has helped me a lot! Also I didn't look into NuVoc til now but rather limited myself to the old vocabulary simply because it is included in the installation. Ehm, since I mentioned it, here's my AoC 9 part I. Of course this does not use u} at all - that part g

Re: [Jprogramming] u} vs m}

2016-12-28 Thread Raul Miller
Note that linear indexes are mathematically equivalent to boxed indexes base (#.) array shape. The problem, though, is that they are atom indices, and not frame indices. -- Raul On Wed, Dec 28, 2016 at 12:56 PM, Brian Schott wrote: > To clarify NuVoc's explanation, first I think I created the

Re: [Jprogramming] u} vs m}

2016-12-28 Thread Brian Schott
To clarify NuVoc's explanation, first I think I created the index list for the current example. ,/>@{(i. 3);i. 2 0 0 0 1 1 0 1 1 2 0 2 1 Then pretending that y is i. 3 2, I applied the expression given in NuVoc and it produces the expected "atom numbers". ($i. 3 2)#. ,/>@{(i. 3);i. 2 0 1 2

Re: [Jprogramming] u} vs m}

2016-12-28 Thread Henry Rich
The Dictionary does discuss this, at http://www.jsoftware.com/help/dictionary/d530v.htm but unfortunately it doesn't mention that the result of u is the atom number. NuVoc in http://code.jsoftware.com/wiki/Vocabulary/curlyrtu#dyadic does describe the case correctly, though without the usual ex

Re: [Jprogramming] u} vs m}

2016-12-28 Thread bill lam
IIRC amend at that time used "linear index". x m} y is ($y) x m} ,y Ср, 28 дек 2016, Cliff Reiter написал(а): > A long, long, time ago in a J far away, indexing was done in i. order. So > indices to a 3 by 2 array would be given by > i.3 2 > > 0 1 > > 2 3 > > 4 5 > > Is it possible t

Re: [Jprogramming] u} vs m}

2016-12-28 Thread Don Guinn
I played with x u}y some more. It seems that y is treated as a vector (rank 1) no matter what rank it actually is. x and u must be either rank 0 or 1 and both the same. Also then number of items in x must match the number of items produced by u. Not sure what is going on. but it does not seem to wo

Re: [Jprogramming] u} vs m}

2016-12-28 Thread Cliff Reiter
A long, long, time ago in a J far away, indexing was done in i. order. So indices to a 3 by 2 array would be given by i.3 2 0 1 2 3 4 5 Is it possible that x u}y is an artifact from that era? On 12/27/2016 3:06 PM, Don Guinn wrote: Just played with the original expression a little a

Re: [Jprogramming] unmatched parenthesis

2016-12-28 Thread Linda A Alvord
Here's the start of an idea: First test if they match or don't match: D=:'((())())' [L=:'('=D 1 1 1 0 0 1 0 0 [R=:')'=E 0 0 1 1 0 0 0 1 1 0=(+/L)-+/R 1 E=:'(())((())' [L=:'('=E 1 1 0 0 1 1 1 0 0 [R=:')'=E 0 0 1 1 0 0 0 1 1 0=(+/L)-+/R 0 Since E is unmat