summaryrefslogtreecommitdiff
path: root/lib/std/slpop.myr
blob: c0291ead79d737fde02ec9a7a8d337d81e8a0a33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use "types"
use "alloc"

pkg std =
	generic slpop	: (sl : @a[:]# -> @a)
;;

generic slpop = {sl
	var elt

	elt = sl#[sl#.len - 1]
	slgrow(sl, sl#.len - 1)
	-> elt
}