shithub: mc

ref: 008887ccd998a43db6980fa57f1e210ec26c4acf
dir: /libstd/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)
	kill(getpid(), 6)
}

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