Documentation ¶
Overview ¶
Package arrays contains functions for manipulating arrays.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Scope = wdte.S().Map(map[wdte.ID]wdte.Func{ "concat": wdte.GoFunc(Concat), "sort": wdte.GoFunc(Sort), "sortStable": wdte.GoFunc(SortStable), "stream": wdte.GoFunc(Stream), })
Scope is a scope containing the functions in this package.
Functions ¶
func Concat ¶ added in v0.2.6
Concat is a WDTE function with the following signatures:
concat array ... (concat array) ...
Returns an array containing the concatonation of all of its arguments, all of which should be arrays, in the order that they were passed to it. For example,
concat [3; 6] [2; 5]
returns
[3; 6; 2; 5]
func Sort ¶ added in v0.2.2
Sort is a WDTE function with the following signatures:
sort array less (sort array) less sort less array (sort less) array
Returns a sorted copy of the given array sorted using the given less function. The less function should take two arguments and return true if the first argument should be sorted earlier in the array then the second. Unlike sortStable, the relative positions of equal elements are undefined in the new array.
func SortStable ¶ added in v0.2.2
SortStable is a WDTE function with the following signatures:
sortStable array less (sortStable array) less sortStable less array (sortStable less) array
Returns a sorted copy of the given array sorted using the given less function. The less function should take two arguments and return true if the first argument should be sorted earlier in the array then the second. Unlike sort, the relative positions of equal elements are preserved.
Types ¶
This section is empty.