[Jprogramming] If utility

2022-04-13 Thread 'Rob B' via Programming
Hi, While looking through the help info I found a reference to an 'if utility' which allows 'if' to be defined as a verb and so be used outside a verb. I cannot find it again, could someone point me to it please? Thanks, Rob.

Re: [Jprogramming] If utility

2022-04-13 Thread Jan-Pieter Jacobs
I think your looking for power (^:), a conjunction though. +: ^: (2&|)"0 i. 8 0 2 2 6 4 10 6 14 which one could read as: double (+:) if (^:) odd (2&|) for each atom ("0) in the input (i. 8). Note that ^: is more general than "if": in u ^: v y, u is applied (v y) times. in the case of odd (2&|

Re: [Jprogramming] If utility

2022-04-13 Thread Hauke Rehr
talking about conjunctions @. is much more like conventional if and works for multiple else-cases (like a switch) eg *:`+:`-@.(3|>./)("1) 3 2 $ i. 6 0 2 4 9 _4 _5 Am 13.04.22 um 15:05 schrieb Jan-Pieter Jacobs: I think your looking for power (^:), a conjunction though. +: ^: (2&|)"

Re: [Jprogramming] If utility

2022-04-13 Thread 'Rob B' via Programming
Thanks, that's all good stuff but what I found was on the lines of if =: 3 : ….an actual verb definition. Regards, Rob. > On 13 Apr 2022, at 14:06, Jan-Pieter Jacobs > wrote: > > I think your looking for power (^:), a conjunction though. > > +: ^: (2&|)"0 i. 8 > 0 2 2 6 4 10 6 14 >

Re: [Jprogramming] If utility

2022-04-13 Thread Raul Miller
On Wed, Apr 13, 2022 at 9:20 AM 'Rob B' via Programming wrote: > Thanks, that's all good stuff but what I found was on the lines of > > if =: 3 : ….an actual verb definition. That might have been https://code.jsoftware.com/wiki/User:Ian_Clark/InspectingValues I hope this helps, -- Raul ---

Re: [Jprogramming] If utility

2022-04-13 Thread Henry Rich
'if' turns out to be an incomplete spec, eh? You can use    if =: ^:    a =. 5    1 + if (>&0) a 6    1 + if (>&10) a 5 Henry Rich On 4/13/2022 9:27 AM, Raul Miller wrote: On Wed, Apr 13, 2022 at 9:20 AM 'Rob B' via Programming wrote: Thanks, that's all good stuff but what I found was on the

Re: [Jprogramming] Help required

2022-04-13 Thread Richard Donovan
Thanks Henry, that’s great! Thanks also to other contributors. Sent from Mail for Windows From: Programming on behalf of Henry Rich Sent: Friday, April 8, 2022 3:32:45 PM To: programm...@jsoftware.com Subject: Re