shithub: mc

ref: 0f3f41fae775b2647cd0cdaf0a9ef395c19b9878
dir: /lib/std/die.myr/

View raw version
use "syswrap"
use "types"

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)
	;;
}