summaryrefslogtreecommitdiff
path: root/lib/std/die.myr
blob: be6dd3003de95d2469fb7d679a47c945ee636887 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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)
	;;
}