shithub: mc

ref: 690ab7aa8e6c56a4ae8a2bd5bce58d1df681234e
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
}