[Jprogramming] fsoj Ch. 34 - addendum re timing results

2018-07-30 Thread Devon McCormick
When I replicated the timings given at the end of this chapter, their relative rankings were drastically different from what is shown in the essay, so I added the following note: *[Be aware that the relative timings may differ for different versions of J depending on code optimizations.] * For any

[Jprogramming] Tacit equivalent of t=: 1 : '%:@:(u/) y'

2018-07-30 Thread Piet Google
Is there a tacit equivalent of the following t=: 1 : '%:@:(u/) y' Help much appreciated. -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] Tacit equivalent of t=: 1 : '%:@:(u/) y'

2018-07-30 Thread 'robert therriault' via Programming
Good question Piet, I needed to think a bit about how adverbs can be written tacitly. Others are considerably more advanced, but here goes: at=: 1 : '%:@:(u/) ' NB. Original adverb + at i. 8 5.2915 a1t=: %:@: NB. First part of adverb is also an adverb +/ a1t i. 8 5.2915 a2t=:

Re: [Jprogramming] Tacit equivalent of t=: 1 : '%:@:(u/) y'

2018-07-30 Thread 'Pascal Jasmin' via Programming
/(%:@:) untested. you can also consider if easier the "semi-tacit": 1 : '%:@:(u/)' semi tacit because the explicit definition disappears after a verb is bound to this adverb.  If you can avoid citing x and y arguments in an adverb, it works ambivalently as another advantage. On Monday, J

[Jprogramming] What's happening here?

2018-07-30 Thread Raul Miller
This bothers me: #(#~ ((-:~.)*(-:\:~))"1)":,.p:1200+i.10 1 #(#~ ((-:~.)*(-:\:~))"1)":,.p:1200+i.20 3 #(#~ ((-:~.)*(-:\:~))"1)":,.p:1200+i.30 0 If someone has a jversion which gives different results, please let me know? I did this with Engine: j806/j64/darwin Release: commercial/2017-11

Re: [Jprogramming] What's happening here?

2018-07-30 Thread Jimmy Gauvin
HI, I am running a much older J and the output is the same : #(#~ ((-:~.)*(-:\:~))"1)":,.p:1200+i.10 1 #(#~ ((-:~.)*(-:\:~))"1)":,.p:1200+i.20 3 #(#~ ((-:~.)*(-:\:~))"1)":,.p:1200+i.30 0 JVERSION Engine: j701/2011-01-10/11:25 Library: 8.02.12 Qt IDE: 1.1.5/4.8.6 Platform: Linux 64 In

Re: [Jprogramming] Tacit equivalent of t=: 1 : '%:@:(u/) y'

2018-07-30 Thread Piet Google
Very clear. Thank you. Are you relying on p.70 part b) of the old "J introduction and dictionary”? I’ve spent hours trying to get my head around this page. Wonderfully cryptic, enlightening and obscure — all at the same time. > On 31 Jul 2018, at 6:56 am, 'robert therriault' via Programming >

Re: [Jprogramming] What's happening here?

2018-07-30 Thread bill lam
Leading fill space for the last sentence On Tue, Jul 31, 2018, 6:00 AM Raul Miller wrote: > This bothers me: > >#(#~ ((-:~.)*(-:\:~))"1)":,.p:1200+i.10 > 1 >#(#~ ((-:~.)*(-:\:~))"1)":,.p:1200+i.20 > 3 >#(#~ ((-:~.)*(-:\:~))"1)":,.p:1200+i.30 > 0 > > If someone has a jversion which gi

Re: [Jprogramming] What's happening here?

2018-07-30 Thread Roger Hui
Why do you think the answers are wrong? I note that p: 1200 + 9 19 29 9811 9887 10007 And the 10007 introduces a leading blank all but the last row of the result of ":,.p:1200+i.30 . Perhaps the function you want to test is: (#~ ((-:~.)*(-:\:~))@":"0) p:1200+i.10 On Mon, Jul 30, 2018 at

Re: [Jprogramming] What's happening here?

2018-07-30 Thread 'Jim Russell' via Programming
Both versions of j for iOS match your results. > On Jul 30, 2018, at 6:00 PM, Raul Miller wrote: > > #(#~ ((-:~.)*(-:\:~))"1)":,.p:1200+i.10 -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] What's happening here?

2018-07-30 Thread Raul Miller
Good call - foggy thinking on my part. Thanks, — Raul On Monday, July 30, 2018, Roger Hui wrote: > Why do you think the answers are wrong? I note that > >p: 1200 + 9 19 29 > 9811 9887 10007 > > And the 10007 introduces a leading blank all but the last row of the result > of ":,.p:1200+i.3

Re: [Jprogramming] Tacit equivalent of t=: 1 : '%:@:(u/) y'

2018-07-30 Thread Brian Schott
*It may be difficult to find the justification for Rob's fine answer in the Dictionary.* *I found the following link helpful, especially it's statement, "... **a train of two adverbs produces an adverb ..."* *http://www.jsoftware.com/help/dictionary/dictf.htm

Re: [Jprogramming] Tacit equivalent of t=: 1 : '%:@:(u/) y'

2018-07-30 Thread 'robert therriault' via Programming
As usual the limited amount of knowledge I have comes from reading the forums and spending some time with Henry Rich's "J for C Programmers". In this case it was Chapter 38 http://www.jsoftware.com/help/jforc/parsing_and_execution_i.htm Chapter 39 http://www.jsoftware.com/help/jforc/parsing_an