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
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
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
----- 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
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 -
>&
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
>
> 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: [
, 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
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
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
10 matches
Mail list logo