shithub: mc

ref: b31626248ea64c23d2020846e2cac1c751348b61
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
}