v2.0.0-beta202
·
633 commits
to master
since this release
Warning: this release breaks BC with previous beta releases
Improvements
- Adding basic support for casting from any array type to []any and back, the following generic array sort implementation is possible now:
func Sort([]any arr, func bool(int, int) cmp) {
int len = arr.Count
for(int i = 1; i <= len - 1; i++) {
for(int j = 0; j < len - i; j++) {
if(cmp(j, j + 1)) {
var temp = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = temp;
}
}
}
}
func test() {
[]int ints = [10, 100, 1]
Sort(ints, func bool(int a, int b) { return ints[b] > ints[a] })
}
- Adding basic support for casting from any map type to [any]any and back
- Removing all copy-value implicit semantics from ValList
- Refactored Val ownership for ValMap making it akin to ValList
- Adding Val.NewNoReset(..) and using it appropriately
- Removing Val.RefMod(..) and replacing it with more specific calls
- Adding basic infrastructure for function trampoline caches
- Adding basic bench infrastructure using BenchmarkDotNet library