wdte: github.com/DeedleFake/wdte/std/arrays Index | Files

package arrays

import "github.com/DeedleFake/wdte/std/arrays"

Package arrays contains functions for manipulating arrays.

Index

Package Files

arrays.go

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.

func Concat Uses

func Concat(frame wdte.Frame, args ...wdte.Func) wdte.Func

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 Uses

func Sort(frame wdte.Frame, args ...wdte.Func) wdte.Func

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 Uses

func SortStable(frame wdte.Frame, args ...wdte.Func) wdte.Func

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.

func Stream Uses

func Stream(frame wdte.Frame, args ...wdte.Func) wdte.Func

Stream is a WDTE function with the following signature:

stream a

Returns a stream.Stream that iterates over the array a.

Package arrays imports 4 packages (graph) and is imported by 1 packages. Updated 2018-11-30. Refresh now. Tools for package owners.