shithub: mc

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

View raw version
use "types"
use "alloc"

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

generic slpop = {sl
	var elt

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