Vocabulary/AET

From J Wiki
Jump to navigation Jump to search

⬅ Return to 'Welcome to J'

⬅ Return to 'NuVoc Reference'

⬅ Return to NuVoc

Absolutely Essential Terms

To make headway with J, even to read NuVoc with profit, you need a clear idea of what these terms mean.

For a more extensive list of J terminology and other helpful terms, see: Vocabulary/Glossary.

  • Click on the term in the TERM column to see its entry in the Glossary
  • Click on More... to see an expanded explanation of the term in its section below.
TERM EXPLANATION SYNONYMS
IN OTHER
LANGUAGES
See more below
Argument A noun that a verb works upon. Always: x or y argument More...
Array A noun comprising atoms arranged along one or more axes. array More...
Atom Any single number, single character, or single box, also known as a scalar. value More...
Box Any noun can be boxed to make it an atom. structure More...
Item A sub-array whose rank is one less than the array's. In a list: an atom. element, row More...
List An array of rank 1. A one-dimensional array. A string or vector. one-dimensional array More...
Locale A public namespace. Each public name is defined in some locale. class More...
Noun An atom or array of atoms. value or array More...
Operand A noun or verb that a modifier works upon. Always: m, n, u, or v. pointer to function (if verb) More...
Primitive A special-format word naming a predefined object, action, action modifier, or control. built-in capability More...
Rank (noun) The number of axes along which the atoms of the noun are arranged. number of dimensions More...
Sentence The executable portion of a line of J code statement More...
Shape The list of the lengths of the axes of a noun. dimensions of array More...
Table An array of rank 2. A two-dimensional array, or matrix. two-dimensional array More...
Verb A "function" or "subroutine" that works on arguments(s) [x or] y. function, program More...
Word A name, a primitive, or a constant. token More...

Explanations of individual terms


Argument

A noun that a verb works upon. There is always a noun to the right (the y-argument) of a verb when the verb is executed.

There is sometimes a noun to the left (the x-argument) too.

If a verb is executed with one argument, the execution is said to be monadic; if two arguments, dyadic.

This corresponds to the concept of unary and binary operators in most programming languages. (- y) means "change the sign of y", while (x - y) means "subtract y from x".


Array

A noun comprising (zero or more) atoms arranged along (one or more) axes.

Some programming languages use the word dimension instead of axis. J arrays are always rectangular.

Arrays are not pre-declared. All verbs can accept arrays as arguments and most create arrays as results. If an array is assigned to a name, that name automatically stands for the entire array.


Atom

Any single number, single character, or single box. Also called a scalar.

An atom is a noun with the rank of zero.

Examples of atoms: 492, 37.5, 'a'


Box

Enclose any noun in a box to create a new noun which behaves as an atom for array purposes.

The verb Box (< y) creates a box whose contents are y.

Boxes can be arranged in an array even if their contents differ in shape or type, to produce a heterogeneous array.

Boxed is one of the types (of noun), along with numeric and character. Because all atoms in an array must be of the same type, it follows that if one is boxed, they must all be boxed.

Boxed atoms can be tested for equality using: Equal (=), or equivalence using: Match (-:), but to make any other use of the contents, the atom, or its atoms, must first be opened ("unboxed" or "disclosed").


Item

A sub-array whose rank is one less than that of the array.

NB. The verb ({. y) produces the first item of y:
   ]a =. 492   NB. An atom
492
   {. a   NB. Its first (and only) item
492
   ]b =. i. 5  NB. A list
0 1 2 3 4
   {. b   NB. Its first item
0
   ]c =. i. 2 4  NB. A table
0 1 2 3
4 5 6 7
   {.c  NB. Its first item
0 1 2 3

List

An array of rank 1.

A one-dimensional array.

Also called a string, if of character type, or a vector, if of numeric type.

   i. 6   NB. A list of numbers
0 1 2 3 4 5
   a. {~ 65 66 67 68 69  NB. A list of characters
ABCDE

Locale

A public namespace.

Each public name is defined in some locale.


Noun

An atom or array of atoms.

But see: User:Ian Clark/AtomsAreArrays.

Nouns are the data that verbs operate on and often produce.


Operand

A noun or verb that a modifier works with to direct or change the effect of a verb.

May be similar to, but not the same as an argument.


Primitive

A special-format word naming a predefined noun, verb, action modifier, or control.


Rank [of a noun]

The number of axes along which the atoms of the noun are arranged.

This is the same as the number of items in the shape of the given noun.

See also:


Sentence

Basically, a single line of J code.

But see: Vocabulary/Glossary#Sentence

A sentence may not span multiple lines.

There is no "continuation character" or "statement delimiter" in J.

The meaning of "sentence" is slightly different in these cases:

  • In the J session window:

- The last line typed from the keyboard, which J executes when ENTER is pressed.

  • In a script:

- Each newline ends a sentence which will be stored or executed during loading.

  • Inside a (verb) definition:

- Sentences may be delimited both by newlines and by control words.

See also:


Shape

The list of the lengths of the axes of a noun.

See also:


Table

An array of rank 2.

A two-dimensional array. A matrix.


Verb

A "function", "program", or "subroutine".

In a sentence, a verb operates on the noun to its right (and its left if there is a noun in that position) to produce a noun result.

See also:


Word

A sequence of characters in a sentence, recognized as a lexical unit.

A word is either a constant, a primitive, or a name.

Every word has a part of speech: noun, verb,adverb, or conjunction.

  • Constants are always nouns.
  • Each primitive has a defined part of speech.
  • A name has the part of speech of the value that was assigned to it.

Examples of words:

  • +
  • 'A string'
  • 12 54
  • user_defined_name

See also: