Re: [Jprogramming] Coprime Dyadic Verb

2014-06-15 Thread Dan Bron
Pascal wrote: > The mistake I make regularly is forgetting that conjunctions are not greedy > to the right. Perhaps it will make it easier to remember if you consider it as a universal rule, rather than some kind of exception for conjunctions: J's grammar would break down if any part of speech we

Re: [Jprogramming] Coprime Dyadic Verb

2014-06-15 Thread Jon Hough
coprime2 =. 1:=+. Ah, of course. I forgot about +. (I thought it was only logical or) > Date: Sun, 15 Jun 2014 10:19:44 -0600 > From: dongu...@gmail.com > To: programm...@jsoftware.com > Subject: Re: [Jprogramming] Coprime Dyadic Verb > > Haven't been following this th

Re: [Jprogramming] Coprime Dyadic Verb

2014-06-15 Thread Don Guinn
Haven't been following this thread very closely. Been distracted. This should be simpler and faster. coprime2 =. 1:=+. On Sun, Jun 15, 2014 at 8:23 AM, 'Pascal Jasmin' via Programming < programm...@jsoftware.com> wrote: > Its rare to forget that adverbs and conjunctions are greedy to the lef

Re: [Jprogramming] Coprime Dyadic Verb

2014-06-15 Thread 'Pascal Jasmin' via Programming
Its rare to forget that adverbs and conjunctions are greedy to the left. The mistake I make regularly is forgetting that conjunctions are not greedy to the right. - Original Message - From: Ric Sherlock try: coprime =. =&0@:(+/)@:(e.&q:) the adverb / is greedy and will try and make t

Re: [Jprogramming] Coprime Dyadic Verb

2014-06-15 Thread David Lambert
Insert, an adverb, consumes the entire verb its left. The entire verb left of / is =&0@:+ Hence parenthesize the verbs. coprime =. =&0@:(+/)@:(e.&q:) 5 coprime 6 1 Date: Sun, 15 Jun 2014 12:49:48 +0100 From: Jon Hough To:"programm...@jsoftware.com" Subject:

Re: [Jprogramming] Coprime Dyadic Verb

2014-06-15 Thread Dan Bron
Your analysis of how that verb acts is correct, with one small exception. Adverbs (and conjunctions) have long left scope, so =&0@:+/ isn't (=&0)@:(+/), it's actually (=&0@:+)/ . So =&0@:+/ 1 1 1 is 1 (=&0@:+) 1 (=&0@:+) 1 . What you want is coprime =. =&0@:(+/)@:(e.&q:) . With that said, w

Re: [Jprogramming] Coprime Dyadic Verb

2014-06-15 Thread Ric Sherlock
try: coprime =. =&0@:(+/)@:(e.&q:) the adverb / is greedy and will try and make the verb to the left as big as possible. I.e. (=&0@:+)/ not just +/ You could also use: coprime=: 0 = +/@:(e.&q:) On Sun, Jun 15, 2014 at 11:49 PM, Jon Hough wrote: > My attempt at a coprime dyadic verb, which retu

[Jprogramming] Coprime Dyadic Verb

2014-06-15 Thread Jon Hough
My attempt at a coprime dyadic verb, which returns 1 for coprime integers and 0 otherwise seems to not work. I do not understand why this verb fails. coprime =. =&0@:+/@:(e.&q:) 5 coprime 6 returns 0. My understanding is thus: Verb is read right to left.First : 5 (e.&q:) 6 is evaluated. This equa