shithub: mc

ref: 8bc429fb93070938b8bc5d459da4f2664c00abae
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)
}