J

J is a modern, high-level, general-purpose, high-performance programming language. J is portable and runs on Windows, Unix, Mac, and PocketPC handhelds, both as a GUI and in a console. True 64-bit J systems are available for XP64 or Linux64, on AMD64 or Intel EM64T platforms. J systems can be installed and distributed for free.

Interface de Consola para el Administrador de Paquetes

’'’Actualiza paquetes instalados’’’

jconsole load ‘pacman’ ‘update’ jpkg ‘’ ‘upgrade’ jpkg ‘’ exit ‘’ }}}

’'’Instalar paquete’’’

jconsole load ‘pacman’ ‘update’ jpkg ‘’ ‘install’ jpkg ‘web/gethttp’ exit ‘’ }}}

Ejemplos

NB. Haskell: 5 +7 NB. Scheme: (+ 5 7) NB. JS: 5 + 7; 5 + 7

NB. Reverse NB. Haskell: reverse “hello” NB. Scheme: (string->list (reverse (String->list “hello”))) NB. JS: “hello”.split(“”).reverse().join(“”); |. ‘hello’

NB. String collection (list) NB. Haskell: “Chris” NB. Scheme: (list “Chris”) ‘Chris’

NB. Integer array (list) NB. Haskell: [43,13,22] NB. Scheme: (list 42 13 22) NB. JS: [42,13,22]; 42 13 22

NB. Ordena lista NB. Haskell: sort [43,13,22] NB. JS: [43,13,22].sort(); NB. JS: “chris”.split(“”).sort().join(“”); /:~ 42 13 22 sort 42 13 22 /:~ ‘chris’ sort ‘chris’

NB. Boxing (tuples???) NB. Haskell: (28,”chirs”) NB. Haskell: (1,”hats”,23/35) NB. JS: [28,”chris”] 28;’chirs’ 1;’hats’;23%35 ‘Shaggy’;’Daphne’;’Velma’

NB. Select from box (select from tuple) NB. Haskell: fst (28,’chirs’) NB. [28,”chirs”][0] . 28;’chirs’

NB. Bound values NB. Haskell: let x NB. JS: x x=: 4 x * x

NB. Haskell: let villan NB. JS: villan villan . villan

NB. Construct a lista NB. Haskell: ‘a’ : ‘b’ : [] or [‘a’,’b’] NB. Haskell: ‘a’ : ‘b’ : [] NB. JS: [‘a’,’b’] ‘a’,’b’ ‘ab’ x x

NB. Suma 1 a lista de 1 a 5 NB. Haskell: map (+1) [1..5] NB. JS: [1,2,3,4,5].map(function(x) return x + 1;}); 2 + / i. 5 2 + i. 5

99 * / 1 + / i. 10 99 * 1 + i. 10

NB. Haskell: map (/5) [13,24,52,42] 13 24 52 42 % / 5 13 24 52 42 % 5

NB. Tryhaskell.org/#15 NB. Haskell: filter (>5) [62,3,25,7,1,9] 62 3 25 7 1 9 > 5

NB. Haskell: let square x (3 : ‘y*y’) 3 square

NB. Haskell: map toUpper “Ernesto” toupper ‘Ernesto’ }}}

Referencia

  • [[[http://www.jsoftware.com/docs/help701/dictionary/vocabul.htm Vocavulary Reference]]]
  • [[[http://www.jsoftware.com/docs/help701/jforc/contents.htm J for C Programmers]]]
  • [[[http://www.jsoftware.com/docs/help701/learning/contents.htm Learning J]]]
  • http://www.jsoftware.com/jwiki/JAL/Package%20Manager/jpkg

CategoryCategory CategoryProgramacion