Re: [Jprogramming] Amending Sequential Rows

2016-11-08 Thread Rob Hodgkinson
Hi Skip, 2 3 ((<@<@<@[){]) 1 2 3 4 5 1 2 5 ex=:(<@<@<@[){] 2 3 ex 1 2 3 4 5 1 2 5 Rob > On 8 Nov. 2016, at 5:44 pm, Skip Cave wrote: > > Aha! except! I had no idea that from '{' had such a useful option. > >(<<< 1 4 5 7) { 2 3 5 7 11 14 56 78 95 > > 2 5 7 56 95 NB. Cool! >

Re: [Jprogramming] Amending Sequential Rows

2016-11-08 Thread Skip Cave
Rob, Thanks. 'Except' is a very useful tool to keep in my toolbox. Frankly, I think there needs to be a wiki page on the J Software site dedicated to exploring this option in more depth. I would have never found out about this if Raul hadn't pointed it out The idea is touched on briefly in the p

Re: [Jprogramming] Amending Sequential Rows

2016-11-08 Thread Rob Hodgkinson
No worries, also FYI I tend to use more ( ) than necessary to clarify very train groupings, but @ in this example operates with a higher level operator precedence, so the innermost parens are not required (sorry, should have removed them). Dissect would also show this quite clearly. 2 3 (<@<

Re: [Jprogramming] Amending Sequential Rows

2016-11-08 Thread Louis de Forcrand
f=: (] dyax ywx)"_ 0 ind ind=: [: I. 2 =/\ ] NB. indices of 1st number in pairs dyax=: +:@{`[`]} NB. double y at x index ywx=: <^:3@] { [ NB. y without x index Take a look at the dictionary page for } (ammend) with gerunds (` expressions). In addition, a triply-boxed left argument to { simply rem

Re: [Jprogramming] Amending Sequential Rows

2016-11-08 Thread 'Mike Day' via Programming
Thanks - I'm not too surprised. v2 is still clunky. My earlier offering is even slower and consumes much more space! But, FWIW, Skip's original example result had 5 rows, the last being the unaltered input data, which is why I added it - that's the one you then remove with }:@:. I now

Re: [Jprogramming] Amending Sequential Rows

2016-11-08 Thread Henry Rich
Did you look at http://code.jsoftware.com/wiki/Vocabulary/curlylf#Complementary_Indexing_and_Omitted_Axes ? It describes this, including pictures of selectors that produce various results. Henry Rich On 11/8/2016 3:27 AM, Skip Cave wrote: Rob, Thanks. 'Except' is a very useful tool to kee

Re: [Jprogramming] Amending Sequential Rows

2016-11-08 Thread Skip Cave
Henry, Yes, I did see that part of the curlylf page. However, I was looking for a discussion of the pattern <<< and I didn't see it there. In fact, when I searched for the text "<<<" on the J Software site, I got zero hits. Well, I did get hits, but when I went to the link, there was never the <<<

Re: [Jprogramming] Amending Sequential Rows

2016-11-08 Thread Raul Miller
It's so much that J has been redefining programming terms, but that those programming terms are usually taken to mean something different from what J does. (Also, if you look closely, a lot of those terms are themselves re-definitions of what used to mean something different.) I do not have an ea

Re: [Jprogramming] Amending Sequential Rows

2016-11-08 Thread Skip Cave
Raul, Yes. I agree that there often just isn't any obvious word that can be used to describe many J primitive functions, not to mention simple J phrases. Thus J has to use words that have meanings somehow related to each function, or just make one up. In either case, it makes it nearly impossible

Re: [Jprogramming] Amending Sequential Rows

2016-11-08 Thread Ric Sherlock
Hi Skip, The document that I found filling this role for me was the J Reference Card linked on the Getting Started page of the wiki. I used these pages both to find the functionality I was looking for to solve an immediate need, but also to i

Re: [Jprogramming] Amending Sequential Rows

2016-11-08 Thread Skip Cave
Louis, Great explanation! Breaking that big tacit verb into smaller verbs that I can test out separately, makes the whole thing much clearer. This was a good learning experience for me. Skip Skip Cave Cave Consulting LLC On Tue, Nov 8, 2016 at 3:42 AM, Louis de Forcrand wrote: > f=: (] dyax

Re: [Jprogramming] Amending Sequential Rows

2016-11-08 Thread Skip Cave
Xiao-Yong posted this code as an adverb: a=:1 :'u@(] +:@{`[`]} <@<@<@]{[)"_ 0 [:I.2=/\]' How does this work? How would I use this? Skip Skip Cave Cave Consulting LLC On Mon, Nov 7, 2016 at 10:25 PM, Xiao-Yong Jin wrote: > So you probably just need this: >f=:(] +:@{`[`]} <@<@<@]{[)"_ 0 [