shithub: mc

ref: 11f9444f151e18547c277027ff39f81c5976318f
dir: /lib/std/die.myr/

View raw version
use "syswrap.use"
use "types.use"

pkg std = 
	$noret const die	: (msg : byte[:] -> void)
	const assert	: (cond : bool, msg : byte[:] -> void)
;;

const die = {msg
	write(2, msg)
	suicide()
}

const assert = {cond, msg
	if !cond
		die(msg)
	;;
}