| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 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 |
|
| 16 |
"Find": reflect.ValueOf(sort.Find), |
| 17 |
"Float64s": reflect.ValueOf(sort.Float64s), |
| 18 |
"Float64sAreSorted": reflect.ValueOf(sort.Float64sAreSorted), |
| 19 |
"Ints": reflect.ValueOf(sort.Ints), |
| 20 |
"IntsAreSorted": reflect.ValueOf(sort.IntsAreSorted), |
| 21 |
"IsSorted": reflect.ValueOf(sort.IsSorted), |
| 22 |
"Reverse": reflect.ValueOf(sort.Reverse), |
| 23 |
"Search": reflect.ValueOf(sort.Search), |
| 24 |
"SearchFloat64s": reflect.ValueOf(sort.SearchFloat64s), |
| 25 |
"SearchInts": reflect.ValueOf(sort.SearchInts), |
| 26 |
"SearchStrings": reflect.ValueOf(sort.SearchStrings), |
| 27 |
"Slice": reflect.ValueOf(sort.Slice), |
| 28 |
"SliceIsSorted": reflect.ValueOf(sort.SliceIsSorted), |
| 29 |
"SliceStable": reflect.ValueOf(sort.SliceStable), |
| 30 |
"Sort": reflect.ValueOf(sort.Sort), |
| 31 |
"Stable": reflect.ValueOf(sort.Stable), |
| 32 |
"Strings": reflect.ValueOf(sort.Strings), |
| 33 |
"StringsAreSorted": reflect.ValueOf(sort.StringsAreSorted), |
| 34 |
|
| 35 |
|
| 36 |
"Float64Slice": reflect.ValueOf((*sort.Float64Slice)(nil)), |
| 37 |
"IntSlice": reflect.ValueOf((*sort.IntSlice)(nil)), |
| 38 |
"Interface": reflect.ValueOf((*sort.Interface)(nil)), |
| 39 |
"StringSlice": reflect.ValueOf((*sort.StringSlice)(nil)), |
| 40 |
|
| 41 |
|
| 42 |
"_Interface": reflect.ValueOf((*_sort_Interface)(nil)), |
| 43 |
} |
| 44 |
} |
| 45 |
|
| 46 |
|
| 47 |
type _sort_Interface struct { |
| 48 |
IValue interface{} |
| 49 |
WLen func() int |
| 50 |
WLess func(i int, j int) bool |
| 51 |
WSwap func(i int, j int) |
| 52 |
} |
| 53 |
|
| 54 |
func (W _sort_Interface) Len() int { return W.WLen() } |
| 55 |
func (W _sort_Interface) Less(i int, j int) bool { return W.WLess(i, j) } |
| 56 |
func (W _sort_Interface) Swap(i int, j int) { W.WSwap(i, j) } |