vector


function vector<Type>(λ:\(Integer) -> Type, length:Integer) -> Type[_]

Create a vector filled by a lambda function.

  • λ: Lambda function.
  • length: Length of the vector.

Returns: The new vector.

The lambda function is called once for each element in the new vector, receiving, as its argument, the index of that element, and returning the value at that element.

function vector<Type>(x:Type, length:Integer) -> Type[_]

Create vector filled with a given value.