shithub: mc

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