shithub: mc

ref: c3e6c525d4716fdaa8839119f4d487f76401f272
dir: /lib/std/die.myr/

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

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

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

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