spice/lib/runtime/value.ml

20 lines
350 B
OCaml

type t =
| Nil
| True
| False
| Int of int64
(* | Obj of vtable * slots *)
let equal v1 v2 =
match v1, v2 with
| Int x, Int y -> Int64.equal x y
| _, _ -> v1 == v2
let to_string = function
| Nil -> "nil"
| True -> "true"
| False -> "false"
| Int n -> Int64.to_string n
let pp ppf v = Format.pp_print_string ppf (to_string v)