J es un lenguaje de programación de alto nivel y propósito general, especialmente adecuado para el análisis matemático, estadístico y lógico de datos. Es una herramienta potente para desarrollar algoritmos y explorar problemas aún no bien comprendidos.
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'
Ayuda en línea (experminetal)
install'github:jpjacobs/general_help'
load'general/help'
Ejuemplos:
help' +' NB. get entry for +
help 'gen';'parts of speech' NB. get parts of speech in section general
help <'# arithmetic' NB. get section Arithmetic
It sources content from a simple text file ~addons/general/help/help.txt, and gets the right part using cut (<;.1 and <;.2) in combination with E. . I’d want to keep it dependency free (so no regex or mapped files) so it would work on the J playground as well. The file is divided in sections starting with ### and entries ending with — (so a section starts with a general entry that can describe it if needed). The first example has two spaces preceding the +, to avoid noise from all examples that happen to use +, and instead return the “+” entry only. I’m also planning to use “{ term}” and “{### section}” as cross references.
