shithub: mc

ref: d073dcc756169e572f54e65f05ba6b4ffaddcde3
dir: /lib/std/slpop.myr/

View raw version
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
}