Re: [Jprogramming] key misunderstanding?

2016-04-22 Thread Dan Bron
Pascal wrote: > 0 0 1 1 1 (2 <\ ])\. i.5 Then: > sorry, key is /. not \. Yep! But to address this: > Something else happens. (called 5 times, in pattern that is hard to > understand). The tally of 0 0 1 1 1 (i.e. # 0 0 1 1 1) is 5, and the dyad f\. has a left rank of 0, so (2 <\ ]) is invoke

Re: [Jprogramming] key misunderstanding?

2016-04-22 Thread 'Pascal Jasmin' via Programming
sorry, key is /. not \. - Original Message - From: 'Pascal Jasmin' via Programming To: Programming Forum Sent: Friday, April 22, 2016 10:46 AM Subject: [Jprogramming] key misunderstanding? 0 0 1 1 1 (2 <\ ])\. i.5 for the inner function (2 <\ ]) I'd expect th

[Jprogramming] key misunderstanding?

2016-04-22 Thread 'Pascal Jasmin' via Programming
0 0 1 1 1 (2 <\ ])\. i.5 for the inner function (2 <\ ]) I'd expect that it would be called twice with 0 1 and 2 3 4 argumnents. Something else happens. (called 5 times, in pattern that is hard to understand). -- For information

Re: [Jprogramming] key

2013-04-25 Thread Thomas Costigliola
In my experience I find that it is useful that the nub, self classify and key cell orderings are the same. On Thu, Apr 25, 2013 at 12:56 AM, Joey K Tuttle wrote: > I share this opinion (and the later caveats for use in APL... :) > > > On 2013/04/24 13:35 , Dan Bron wrote: > >> Occurrence in x.

Re: [Jprogramming] key

2013-04-24 Thread Joey K Tuttle
I share this opinion (and the later caveats for use in APL... :) On 2013/04/24 13:35 , Dan Bron wrote: Occurrence in x. It's not even a question. Anything else is heresy. -- For information about J forums see http://www.jsof

Re: [Jprogramming] key

2013-04-24 Thread Dan Bron
Or, hmm, maybe since it's APL, you don't call f at all, you just replace missing keys in the output with ⍬ (zilde)? -Dan -Original Message- From: Dan Bron [mailto:j...@bron.us] Sent: Wednesday, April 24, 2013 4:35 PM To: 'programm...@jsoftware.com' Subject: RE

Re: [Jprogramming] key

2013-04-24 Thread Dan Bron
s.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Roger Hui Sent: Wednesday, April 24, 2013 3:05 PM To: Programming forum Subject: Re: [Jprogramming] key Thank you to everyone who responded. A further question: do you prefer that the cells be ordered by their occurrence in x, or do

Re: [Jprogramming] key

2013-04-24 Thread Henry Rich
I don't think it will matter much if you make the dyadic change, but I don't see any reason (except efficiency) to sort. I can't think of a case where it would matter one way or the other. Henry Rich On 4/24/2013 3:05 PM, Roger Hui wrote: Thank you to everyone who responded. A further quest

Re: [Jprogramming] key

2013-04-24 Thread Raul Miller
For me, the answer to that is application dependent. But I haven't had any problem with the current behavior. That said, thinking about this - it's easy to sort by x. It's harder to recover from a sort (not a lot harder, but still noticeable). Thanks, -- Raul On Wed, Apr 24, 2013 at 3:05 PM, R

Re: [Jprogramming] key

2013-04-24 Thread Roger Hui
Thank you to everyone who responded. A further question: do you prefer that the cells be ordered by their occurrence in x, or do you prefer that they be sorted (by x)? On Mon, Apr 15, 2013 at 5:43 PM, Roger Hui wrote: > I have a question concerning your use of *key*. Do you find yourself > wi

Re: [Jprogramming] key

2013-04-16 Thread Roger Hui
This thread caused me to look at the following message from 2009 http://www.jsoftware.com/pipermail/programming/2009-November/016859.html From: Raul Miller Date: Sat Nov 14 03:33:39 HKT 2009 Subject: rank by key On Fri, Nov 13, 2009 at 1:10 PM, Tirrell, Jordan (Consultant) > key=: 1 1,1 0,1 1,1 0

Re: [Jprogramming] key

2013-04-16 Thread Roger Hui
It'd be a good exercise for somebody. The main work would be in the code to "recognize" special cases of f@]/.. rather than f/. The code is in file ao.c . On Tue, Apr 16, 2013 at 5:53 AM, Jose Mario Quintana < jose.mario.quint...@gmail.com> wrote: > " > This does not mean that the J definition

Re: [Jprogramming] key

2013-04-16 Thread R.E. Boss
3 2:43 > Aan: Programming forum > Onderwerp: [Jprogramming] key > > I have a question concerning your use of *key*. Do you find yourself > wishing that in x f/.y, the f would be invoked with a left argument which > is key value corresponding to the items in the right argument? T

Re: [Jprogramming] key

2013-04-16 Thread David Ward Lambert
In x f/.y have I ever used verb f that includes {. ? Yes. -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] key

2013-04-16 Thread Jose Mario Quintana
" This does not mean that the J definition or implementation will be changed " Why not? I would not like to be left behind :) Compatibility? It could be added as (/..). On Mon, Apr 15, 2013 at 8:43 PM, Roger Hui wrote: > I have a question concerning your use of *key*. Do you find yourself

Re: [Jprogramming] key

2013-04-16 Thread Raul Miller
More likely (, #)/..~ The downside of dyadic u in key is that it would break existing code. Including, of course: ({. , #)/.~ FYI, -- Raul On Tue, Apr 16, 2013 at 6:48 AM, Ric Sherlock wrote: > I agree it would be nice. If I understand correctly, the proposed > definition would allow the f

Re: [Jprogramming] key

2013-04-16 Thread Ric Sherlock
I agree it would be nice. If I understand correctly, the proposed definition would allow the following replacement: ( ({. , #)/.~ ) becomes ( (, #)/.~ ) On Tue, Apr 16, 2013 at 4:15 PM, Raul Miller wrote: > I have often wished for that. > > -- > Raul > > On Mon, Apr 15, 2013 at 8:43 PM, Ro

Re: [Jprogramming] key

2013-04-15 Thread Raul Miller
I have often wished for that. -- Raul On Mon, Apr 15, 2013 at 8:43 PM, Roger Hui wrote: > I have a question concerning your use of *key*. Do you find yourself > wishing that in x f/.y, the f would be invoked with a left argument which > is key value corresponding to the items in the right argu

Re: [Jprogramming] key

2013-04-15 Thread Henry Rich
Yes, very much. I am continually writing x (~.@[ ... f/.) y And what does it cost? f@]/. would get the current behavior. Henry Rich On 4/15/2013 8:43 PM, Roger Hui wrote: I have a question concerning your use of *key*. Do you find yourself wishing that in x f/.y, the f would be invoked wit

Re: [Jprogramming] key

2013-04-15 Thread Dan Bron
Yes. Please excuse typos; composed on a handheld device. On Apr 15, 2013, at 6:43 PM, Roger Hui wrote: > I have a question concerning your use of *key*. Do you find yourself > wishing that in x f/.y, the f would be invoked with a left argument which > is key value corresponding to the items

[Jprogramming] key

2013-04-15 Thread Roger Hui
I have a question concerning your use of *key*. Do you find yourself wishing that in x f/.y, the f would be invoked with a left argument which is key value corresponding to the items in the right argument? This does not mean that the J definition or implementation will be changed, but to find out