Some identities in the J computer language.<p><pre><code> 0: :- (+-)
0 -: (0: 0)
0 -: (0: 7)
1: :- (*%)
]: :- (+0:)
]: :- (*1:)
]: :- ] + 0:
]: :- ] * 1:
1 -: 1 1 1 = 2 2 2 = 2 2 2
10 = 2*1+4
0: -: 0: + 0:
1: -: 0: + 1:
+: -: ] + ]
*: -: ] * ]
(],[) -: ([,])~
+: -: +~
*: -: *~
> -: <~
< -: >~
1: -: =~
*~ -: ] * ]
0: -: -~
] -: (]])
10 3 = 3 (] , [) 10
3&* -: (* 3:)
%&3 -: (% 3:)
10 20 30 10 20 30 -: ,~ 10 20 30
14 49 0 1 -: (+:,*:,0:,1:) 7
A simple test:
test =: (],[) -: ([,])~
10 test 20</code></pre>
1<p>I wonder if some LLM or intelligent person could guess what those symbols and identities mean given a large list of identities.<p>Spoiler:
0: :- (+-) .NB for all x, 0 = x + (-x)
1: :- (<i>%) .NB for all x, 1 = x </i> (1/x)
]: :- (+0:) .NB for all x, x = x + 0
4 -: #'long'
'f' -: {. 'first'
't' -: {: 'last'
'wd' -: ({.,{:) 'word'