shithub: mc

ref: 46bc8592a6cd4b2be507057f19bbb4e085e89bf2
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)
	;;
}