Jump to content

Wikifunctions:Catalogue/List operations

From Wikifunctions

Basic list/iterable functions

Complex list/iterable functions

Functions with list outputs

Complete list

  1. If a function specifies an output list with a type other than Object (Z1) (that is, it specifies a "properly typed" list), mismatched elements cause an error if the implementation is in code.
  2. If all objects in an output list have the same type, the list takes that type instead of being Z1-typed. This only happens if the implementation is in code. For compositions, you can use return Typed list (Z18475) to get the same result.
  3. If a code implementation needs converted objects (provided by a Type converter to code (Z46)), any list input must be properly typed (objects in a Z1-typed list are not converted). Similarly, any list output must be properly typed (not Object (Z1) in the function specification) or else conversion into a Wikifunctions object will fail.
  4. If a code implementation does not need converted objects, you can use untype a list (Z17895) to convert a properly typed list to Z1-typed (but this is not officially supported).

In-built functions with list outputs

These operate on object-typed lists, so may not need a different version for each type. However, code implementations cannot currently generate lists of objects (other than string/boolean). So code implementations will not work on these functions.