shithub: mc

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

View raw version
use "types"
use "alloc"

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

generic slpop = {sl
	var elt

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