Commit de777ecd by charguer

### Merge branch 'master' of gitlab.inria.fr:charguer/cfml

parents f16cb659 ac75298b
This diff is collapsed.
 ... ... @@ -16,7 +16,7 @@ external magic : 'a -> 'b = "%magic" (************************************************************) (** Boolean *) let not x = let not x = if x then false else true ... ... @@ -25,7 +25,7 @@ let not x = external ( == ) : 'a -> 'a -> bool = "%physical_eq" let ( != ) x y = let ( != ) x y = not (x == y) ... ... @@ -40,15 +40,15 @@ external ( <= ) : 'a -> 'a -> bool = "%compare_le" external ( >= ) : 'a -> 'a -> bool = "%compare_ge" (* CFML does not support reasoning about polymorphic comparison let min x y = let min x y = if x <= y then x else y let max x y = let max x y = if x >= y then x else y *) let min (x:int) (y:int) = if x <= y then x else y let max (x:int) (y:int) = let max (x:int) (y:int) = if x >= y then x else y (* Alternative to also support float ... ... @@ -81,7 +81,7 @@ let succ n = let pred n = n - 1 let abs (x:int) = let abs (x:int) = if x >= 0 then x else -x ... ... @@ -103,14 +103,14 @@ external ( asr ) : int -> int -> int = "%int_asr" type 'a ref = { mutable contents : 'a } let ref x = let ref x = { contents = x } let (!) r = r.contents let (!) r = r.contents let (:=) r x = r.contents <- x let (:=) r x = r.contents <- x let incr r = r := !r + 1 ... ... @@ -130,7 +130,7 @@ let ref_unsafe_set r x = let fst (x,y) = x let snd (x,y) = let snd (x,y) = y ... ... @@ -141,6 +141,15 @@ let ignore x = () (************************************************************) (** Lists *) let rec ( @ ) l1 l2 = match l1 with | [] -> l2 | hd :: tl -> hd :: (tl @ l2) (************************************************************) (** Float *) ... ...
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment