shithub: mc

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