Vocabulary/plusco

From J Wiki
Jump to navigation Jump to search

>> <<   Down to: Dyad   Back to: Vocabulary Thru to: Dictionary

+: y Double

Rank 0 -- operates on individual atoms of y, producing a result of the same shape -- WHY IS THIS IMPORTANT?


Equivalent to 2 * y.

   +: 7
14

Common uses

Can lead to neater tacit expressions

   13 : '2*y'
2 * ]
   13 : '+:y'
+:

More Information

Double video

Related Primitives

Halve (-: y), Square Root (%: y), Square (*: y)


x +: y Not-Or

Rank 0 0 -- operates on individual atoms of x and y, producing a result of the same shape -- WHY IS THIS IMPORTANT?


The logical operation Not-Or between two Boolean nouns x and y, which is 0 (false) if x or y is 1 (true).

in other words, the same as -. x +. y

   0 0 1 1 +: 0 1 0 1
1 0 0 0
   (0 1) +:/ (0 1)      NB. Truth-table of: +:
1 0
0 0
   (0 1) +:table (0 1)  NB. Truth-table with borders
+--+---+
|+:|0 1|
+--+---+
|0 |1 0|
|1 |0 0|
+--+---+

Note: (+:) is restricted to Boolean arguments

   1 +: 2
|domain error
|   1    +:2

More Information

NotOr video

Related Primitives

Or (x +. y), LCM (And) (x *. y), Not-And (x *: y), Not (-. y), Boolean Functions (m b.)