ensure multimethod

Methods

ensure(x:Any, t:Type)experimental Source: stdlib.ngs:1433
EXPERIMENTAL! Do not use! Makes sure returned value is of type t. If x is already of type t, returns x. Otherwise, returns object of type t with single item x.

Parameters

ta subtype of Eachable1

Returns

Object of type t
ensure(x:Arr, t:Type) Source: stdlib.ngs:1541
Undocumented

Parameters

tsubtype of ArrLike

Returns

of type t
ensure(n:Int, r:NumRange) Source: stdlib.ngs:2260
Checks that x is in the range.

Example

ensure(3, 3..10)  # 3