github.com/HaHadaxigua/yaegi@v1.0.1/stdlib/go1_16_sort.go (about)

     1  // Code generated by 'yaegi extract sort'. DO NOT EDIT.
     2  
     3  // +build go1.16,!go1.17
     4  
     5  package stdlib
     6  
     7  import (
     8  	"reflect"
     9  	"sort"
    10  )
    11  
    12  func init() {
    13  	Symbols["sort/sort"] = map[string]reflect.Value{
    14  		// function, constant and variable definitions
    15  		"Float64s":          reflect.ValueOf(sort.Float64s),
    16  		"Float64sAreSorted": reflect.ValueOf(sort.Float64sAreSorted),
    17  		"Ints":              reflect.ValueOf(sort.Ints),
    18  		"IntsAreSorted":     reflect.ValueOf(sort.IntsAreSorted),
    19  		"IsSorted":          reflect.ValueOf(sort.IsSorted),
    20  		"Reverse":           reflect.ValueOf(sort.Reverse),
    21  		"Search":            reflect.ValueOf(sort.Search),
    22  		"SearchFloat64s":    reflect.ValueOf(sort.SearchFloat64s),
    23  		"SearchInts":        reflect.ValueOf(sort.SearchInts),
    24  		"SearchStrings":     reflect.ValueOf(sort.SearchStrings),
    25  		"Slice":             reflect.ValueOf(sort.Slice),
    26  		"SliceIsSorted":     reflect.ValueOf(sort.SliceIsSorted),
    27  		"SliceStable":       reflect.ValueOf(sort.SliceStable),
    28  		"Sort":              reflect.ValueOf(sort.Sort),
    29  		"Stable":            reflect.ValueOf(sort.Stable),
    30  		"Strings":           reflect.ValueOf(sort.Strings),
    31  		"StringsAreSorted":  reflect.ValueOf(sort.StringsAreSorted),
    32  
    33  		// type definitions
    34  		"Float64Slice": reflect.ValueOf((*sort.Float64Slice)(nil)),
    35  		"IntSlice":     reflect.ValueOf((*sort.IntSlice)(nil)),
    36  		"Interface":    reflect.ValueOf((*sort.Interface)(nil)),
    37  		"StringSlice":  reflect.ValueOf((*sort.StringSlice)(nil)),
    38  
    39  		// interface wrapper definitions
    40  		"_Interface": reflect.ValueOf((*_sort_Interface)(nil)),
    41  	}
    42  }
    43  
    44  // _sort_Interface is an interface wrapper for Interface type
    45  type _sort_Interface struct {
    46  	IValue interface{}
    47  	WLen   func() int
    48  	WLess  func(i int, j int) bool
    49  	WSwap  func(i int, j int)
    50  }
    51  
    52  func (W _sort_Interface) Len() int {
    53  	return W.WLen()
    54  }
    55  func (W _sort_Interface) Less(i int, j int) bool {
    56  	return W.WLess(i, j)
    57  }
    58  func (W _sort_Interface) Swap(i int, j int) {
    59  	W.WSwap(i, j)
    60  }