comparison lib/ur/top.ur @ 2151:4cd36865e0b5

assert function to use with location literal _LOC_
author Gabriel Riba Faura <griba2001@gmail.com>
date Wed, 03 Jun 2015 15:07:46 +0200
parents a3435112b83e
children 2d9e40e726f2
comparison
equal deleted inserted replaced
2150:763ccca119bc 2151:4cd36865e0b5
408 408
409 fun max [t] ( _ : ord t) (x : t) (y : t) : t = 409 fun max [t] ( _ : ord t) (x : t) (y : t) : t =
410 if x > y then x else y 410 if x > y then x else y
411 fun min [t] ( _ : ord t) (x : t) (y : t) : t = 411 fun min [t] ( _ : ord t) (x : t) (y : t) : t =
412 if x < y then x else y 412 if x < y then x else y
413
414 fun assert [a] (cond: bool) (msg: string) (loc: string) (x:a): a =
415 if cond then x else error <xml>{[msg]} at {[loc]}</xml>