ref: 89b3d0c393d0fc58ce185fad5e841edf077b810b
parent: 2b8417dc460c93814e7cef07bf1934c8deb59dd2
author: andrewc <andrewchamberss@gmail.com>
date: Mon Mar 7 06:02:03 EST 2016
make slpop take a pointer to a slice
--- a/lib/std/slpop.myr
+++ b/lib/std/slpop.myr
@@ -2,13 +2,13 @@
use "alloc"
pkg std =
- generic slpop : (sl : @a[:] -> (@a, @a[:]))
+ generic slpop : (sl : @a[:]# -> @a)
;;
generic slpop = {sl
var elt
- elt = sl[sl.len - 1]
- slgrow(&sl, sl.len - 1)
- -> (elt, sl)
+ elt = sl#[sl#.len - 1]
+ slgrow(sl, sl#.len - 1)
+ -> elt
}