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&|)"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&|) it happens to be either 0 or 1 time.

See https://code.jsoftware.com/wiki/Vocabulary/hatco for more info.

Hope this helps!

Jan-Pieter

On Wed, 13 Apr 2022, 14:52 'Rob B' via Programming, <
programm...@jsoftware.com> wrote:

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.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

--
----------------------
mail written using NEO
neo-layout.org
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to