shithub: mc

ref: 5bd859be6d2246db8a5ce28f2dbc25724590cb6f
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)
}