Re: [Jprogramming] maybe a bug in short circuiting. Help with a guard structure

2014-01-15 Thread Pascal Jasmin
thank you Raul.  I thought the x parameter was not necessary. - Original Message - From: Raul Miller To: Programming forum Cc: Sent: Wednesday, January 15, 2014 12:29:54 PM Subject: Re: [Jprogramming] maybe a bug in short circuiting. Help with a guard structure   3 +^:1: 2 5

Re: [Jprogramming] maybe a bug in short circuiting. Help with a guard structure

2014-01-15 Thread Raul Miller
inition of guard > > guard =: 2 : 0 > : > (u@:[)^: (v y) 1 > ) > > > - Original Message - > From: Brian Schott > To: Programming forum > Cc: > Sent: Wednesday, January 15, 2014 8:42:23 AM > Subject: Re: [Jprogramming] maybe a bug in short circuiting. Help w

Re: [Jprogramming] maybe a bug in short circuiting. Help with a guard structure

2014-01-15 Thread Pascal Jasmin
derstand. original definition of guard guard =: 2 : 0  : (u@:[)^: (v y) 1 )  - Original Message - From: Brian Schott To: Programming forum Cc: Sent: Wednesday, January 15, 2014 8:42:23 AM Subject: Re: [Jprogramming] maybe a bug in short circuiting. Help with a guard structu

Re: [Jprogramming] maybe a bug in short circuiting. Help with a guard structure

2014-01-15 Thread Brian Schott
----- Original Message ----- > From: Raul Miller > To: Programming forum > Cc: > Sent: Wednesday, January 15, 2014 12:37:08 AM > Subject: Re: [Jprogramming] maybe a bug in short circuiting. Help with a > guard structure > > Oops, you are correct, and I was wrong. I sho

Re: [Jprogramming] maybe a bug in short circuiting. Help with a guard structure

2014-01-15 Thread Raul Miller
y trying to >> illustrate noun expressions, and I understand now that it may not be >> possible. >> >> My main question was in the second part, and asking why the 'guard' >> conjunction doesn't work. >> >> >> - Original Message - >&

Re: [Jprogramming] maybe a bug in short circuiting. Help with a guard structure

2014-01-14 Thread Pascal Jasmin
014 12:37:08 AM Subject: Re: [Jprogramming] maybe a bug in short circuiting. Help with a guard structure Oops, you are correct, and I was wrong. I should have tested against an example. Anyways, a fix that retains your result pattern would be to replace sideff y with sideff bind y (this will

Re: [Jprogramming] maybe a bug in short circuiting. Help with a guard structure

2014-01-14 Thread Raul Miller
> > My main question was in the second part, and asking why the 'guard' > conjunction doesn't work. > > > - Original Message - > From: Raul Miller > To: Programming forum > Cc: > Sent: Tuesday, January 14, 2014 11:38:12 PM > Subject: Re: [

Re: [Jprogramming] maybe a bug in short circuiting. Help with a guard structure

2014-01-14 Thread Pascal Jasmin
, January 14, 2014 11:38:12 PM Subject: Re: [Jprogramming] maybe a bug in short circuiting. Help with a guard structure Yes. > if. -. (2 = sideff y)"_ ^: (*./ y) 1 do. 'bad' return. end. J needs to resolve the contents of the parenthesis to a single entity (noun, verb, adverb

Re: [Jprogramming] maybe a bug in short circuiting. Help with a guard structure

2014-01-14 Thread Raul Miller
Yes. > if. -. (2 = sideff y)"_ ^: (*./ y) 1 do. 'bad' return. end. J needs to resolve the contents of the parenthesis to a single entity (noun, verb, adverb or conjunction). In this case I think you want a verb, which would be controlled by ^: Also, I do not see that that "_ does anything usefu

Re: [Jprogramming] maybe a bug in short circuiting. Help with a guard structure

2014-01-14 Thread Pascal Jasmin
the following attempts to code the one line pattern with one less if. : if. test1 y do. if. -. test2 x do. 'test2 failed' return. end. end. The problem is that the verb sideff is called even if it shouldn't be. test=: 3 : 0 if. -. (2 = sideff y)"_ ^: (*./ y) 1 do. 'bad' return. end. ) sideff =: 3