from Hacker News

Some identities in J (array language)

by veryveryold on 1/28/25, 10:41 PM with 1 comments

Some identities in the J computer language.

   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
1

I wonder if some LLM or intelligent person could guess what those symbols and identities mean given a large list of identities.

Spoiler: 0: :- (+-) .NB for all x, 0 = x + (-x) 1: :- (%) .NB for all x, 1 = x (1/x) ]: :- (+0:) .NB for all x, x = x + 0 4 -: #'long' 'f' -: {. 'first' 't' -: {: 'last' 'wd' -: ({.,{:) 'word'

  • by Pompidou on 2/6/25, 11:00 AM

    -: and :- are not the same... Maybe some typos... But your list shows how left and right terms are the same in each identities. Look like some pedagogical stuff.

    For instance :

    (],[) -: ([,])~

    (],[) Appends right and left term while ([,])~ append left and right term after arguments order inversion.