github.com/switchupcb/yaegi@v0.10.2/stdlib/go1_17_sort.go (about)

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