Vocabulary: Difference between revisions
(→Noun) |
("Widen scope of language category") |
||
(16 intermediate revisions by 2 users not shown) | |||
Line 8: | Line 8: | ||
* Dictionary |
* Dictionary |
||
* Array |
* Array |
||
* Table |
|||
== Verb == |
== Verb == |
||
A verb is a primitive function in K. K has 20 primitive verbs which represent multiple overloads that form its base functionality. |
|||
== Adverb == |
== Adverb == |
||
An adverb is a primitive syntactical form in K which takes 1 or 2 functions on the left and changes their functionality. |
|||
== Dictionary == |
== Dictionary == |
||
A K dictionary is a mapping from a set of K nouns as keys to a set of K nouns which constitute the values of the dictionary. Keys may not need to be unique, depending on the K version. |
|||
== Function == |
== Function == |
||
A function can be a: |
|||
* Primitive verb |
|||
* Lambda |
|||
* Train |
|||
* Projection of any of the above. |
|||
== Valence == |
== Valence == |
||
The valence of a noun which supports application(function, array, dict) is the number of arguments it can take. K primitives are usually multi-valent and support different overloads for different valences. |
|||
== Monad == |
== Monad == |
||
A Monad is a function which has valence 1 (single argument function). |
|||
== Dyad == |
== Dyad == |
||
A Dyad is a function which has valence 2 (two argument function). |
|||
== Matrix == |
== Matrix == |
||
A matrix is a 2D array (a list of lists) where all elements have the same length. |
|||
== Shape == |
== Shape == |
||
The shape of an array is the length of each dimension in it. |
|||
== Conform == |
== Conform == |
||
Conforming is a rule that applies to arithmetic verbs in K. A conforming operation is one which can take two arrays with arbitrary shape and line up each atom with a corresponding atom, preserving the structure of one of the given arguments. Conforming operations can only be done on arrays which recursively conform in terms of element length. |
|||
== Atomic == |
== Atomic == |
||
An atomic operation is one which can work on the lowest atoms of an array. Atoms can be one of: |
|||
* Integer |
|||
* Character |
|||
* Float |
|||
* Symbol |
|||
== Vector == |
== Vector == |
||
A vector is a simple list that contains no subarrays. |
|||
== Scalar == |
== Scalar == |
||
A scalar is the smallest individual unit that can the added to an array, that is not an array. Otherwise this is See [[Vocabulary#Atomic|Atomic]] for the types of scalars. |
|||
== Lambda == |
== Lambda == |
||
The basic universal syntax for defining functions is the K lambda. A lambda with no arguments defined has its first three arguments stored in variables x, y and z. A lambda also has a variable for self reference (recursion). |
|||
[[Category:Language]] |
Latest revision as of 08:14, 9 July 2022
The following page documents K related words. All definitions written here should be hence treated as such, and not as an extension of their English counterparts.
Noun[edit]
A noun is a basic value in K, which can be a:
- Number
- Character
- Symbol
- Function
- Dictionary
- Array
- Table
Verb[edit]
A verb is a primitive function in K. K has 20 primitive verbs which represent multiple overloads that form its base functionality.
Adverb[edit]
An adverb is a primitive syntactical form in K which takes 1 or 2 functions on the left and changes their functionality.
Dictionary[edit]
A K dictionary is a mapping from a set of K nouns as keys to a set of K nouns which constitute the values of the dictionary. Keys may not need to be unique, depending on the K version.
Function[edit]
A function can be a:
- Primitive verb
- Lambda
- Train
- Projection of any of the above.
Valence[edit]
The valence of a noun which supports application(function, array, dict) is the number of arguments it can take. K primitives are usually multi-valent and support different overloads for different valences.
Monad[edit]
A Monad is a function which has valence 1 (single argument function).
Dyad[edit]
A Dyad is a function which has valence 2 (two argument function).
Matrix[edit]
A matrix is a 2D array (a list of lists) where all elements have the same length.
Shape[edit]
The shape of an array is the length of each dimension in it.
Conform[edit]
Conforming is a rule that applies to arithmetic verbs in K. A conforming operation is one which can take two arrays with arbitrary shape and line up each atom with a corresponding atom, preserving the structure of one of the given arguments. Conforming operations can only be done on arrays which recursively conform in terms of element length.
Atomic[edit]
An atomic operation is one which can work on the lowest atoms of an array. Atoms can be one of:
- Integer
- Character
- Float
- Symbol
Vector[edit]
A vector is a simple list that contains no subarrays.
Scalar[edit]
A scalar is the smallest individual unit that can the added to an array, that is not an array. Otherwise this is See Atomic for the types of scalars.
Lambda[edit]
The basic universal syntax for defining functions is the K lambda. A lambda with no arguments defined has its first three arguments stored in variables x, y and z. A lambda also has a variable for self reference (recursion).