Domain and range

From The K Language Wiki
Revision as of 21:26, 8 July 2021 by Ngn (talk | contribs) (Created page with "The '''domain''' of a function is the set of arguments for which it is defined. Its '''range''' is the set of values it could return. Thanks to the unification of funct...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The domain of a function is the set of arguments for which it is defined. Its range is the set of values it could return. Thanks to the unification of function application, list indexing, and dictionary lookup, the concepts of domain and range extend to any k object.

The domain of a list is !#x and its range is the list itself. This is valid for tables too.

The domain of a dictionary is its keys !x and the range is its values . x.