func Sort(frame wdte.Frame, args ...wdte.Func) wdte.Func {
	frame = frame.Sub("sort")
	return sorter(sort.Slice).Call(frame, args...)
}
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.
package arrays
import (
	"sort"
	"github.com/DeedleFake/wdte"
	"github.com/DeedleFake/wdte/std"
	"github.com/DeedleFake/wdte/wdteutil"
)
func Concat(frame wdte.Frame, args ...wdte.Func) wdte.Func {
	frame = frame.Sub("concat")
	if len(args) < 2 {
		return wdteutil.SaveArgs(wdte.GoFunc(Concat), args...)
	}
	array := args[0].(wdte.Array)
	for _, arg := range args[1:] {
		array = append(array[:len(array):len(array)], arg.(wdte.Array)...)
	}
	return array
}
func sorter(sortFunc func(interface{}, func(int, int) bool)) (f wdte.GoFunc) {
	return func(frame wdte.Frame, args ...wdte.Func) wdte.Func {
		if len(args) < 2 {
			return wdteutil.SaveArgs(f, args...)
		}
		var array wdte.Array
		var less wdte.Func
		switch a := args[0].(type) {
		case wdte.Array:
			array = a
			less = args[1]
		default:
			less = a
			array = args[1].(wdte.Array)
		}
		type errorFunc interface {
			wdte.Func
			error
		}
		var err errorFunc
		array = append(wdte.Array{}, array...)
		sortFunc(array, func(i1, i2 int) bool {
			if err != nil {
				return false
			}
			r := less.Call(frame, array[i1], array[i2])
			if e, ok := r.(errorFunc); ok {
				err = e
				return false
			}
			return r == wdte.Bool(true)
		})
		if err != nil {
			return err
		}
		return array
	}
}