shithub: mc

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

View raw version
use "types.use"
use "alloc.use"

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

generic slpop = {sl
	var elt

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