shithub: mc

ref: 1c7f39ccba2038892671bcb708adf32bbf39c157
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)
}