Domain and range

From The K Language Wiki
(Redirected from Domain)

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.