Jx Extensions

License

The J Software release, Tacit Programming Extension patches and code and shared libraries are licensed under the GNU GPL v3.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
http://www.gnu.org/licenses/gpl.html

Binaries

UNTESTED - Use at your own risk.
Windows 64bit binary: j.dll
Linux 64bit binary: libj.so

Patch

Official J806 source patch generated from official commit 5cec3b69 .

Cheatsheet

Jx1 Cheatsheet

Extensions

Trains

u (c a) v  ↔  u c v a
   *: (@ /) -
*:@-/

The product of (u c v) is not required to be a noun or verb and it is passed as an argument to the adverb a.

u (a c a) v  ↔  (u a) c (v a)
   + (/@/) -
+/@(-/)

The products of (u a) and (v a) are not required to be a noun or verb and they are passed as arguments to the conjunction c.

a v  ↔  v(a)

The verb is executed with the adverb as its argument, e.g.,

   / <
┌─┐
│/│
└─┘
a c  ↔  a(c) 

The adverb is executed with the conjunction as its argument, e.g.,

   ]: &
┌───┬──┐
│┌─┐│]:│
││&││  │
│└─┘│  │
└───┴──┘
x (a a)  ↔  (x a) a

The product of (x a) is not required to be a noun or verb and ((x a) a) produces a train if (x a) produces an adverb or conjunction.

NB. x a0 producing a verb (the official case)

assert (+((]adv)/))<adv  -: (+/ <adv)

NB. x a0 producing an adverb...

assert (((/<)( (>adv)\ ) )<) -: (/\ <)

Primitives

test=. verb define

  =::~ 'XX'
  echo  XX

  =..~ 'XXX'
  echo  XXX

)

test ''

assert 'XX' -: ". 'XX'
assert ''   -: ". 'XXX'

   [: +/ - 0 1 2 ]:
┌──┬─┬─────┐
│+/│-│0 1 2│
└──┴─┴─────┘
    (;:'ver conj adv')=. _3 _2 _1<@(?:"0) 0
assert ((i.2 3) ((104!:5) ((5!:1)@<))) -: ("..^:_1 i.2 3)
    +:`|:"::2 i. 2 2 3
0  2  4
6  8 10
0  0  0

6  9  0
7 10  0
8 11  0

Unicode Names

Unicode characters are legal inside names.

   'λ λ0 λ1' =. 1 2 3
   λ , λ0 , λ1
1 2 3

Boxed Sparse Arrays

Sparse arrays can be boxed and retrieved from a boxed array.

   ]A=. 'sparse';7;$.3=7&|i.30
┌──────┬─┬──────┐
│sparse│7│ 3 │ 1│
│      │ │10 │ 1│
│      │ │17 │ 1│
│      │ │24 │ 1│
└──────┴─┴──────┘
   2{::A
 3 │ 1
10 │ 1
17 │ 1
24 │ 1