From 0b56c62c7f767b49bc2e71923f7211c9c2f61172 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 21 Feb 2012 08:49:44 +0000 Subject: [PATCH] Export string_of_variable utility function. --- lib/whenutils.ml | 6 +++--- lib/whenutils.mli | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/whenutils.ml b/lib/whenutils.ml index 461af5a..ed1b065 100644 --- a/lib/whenutils.ml +++ b/lib/whenutils.ml @@ -337,11 +337,11 @@ and compare_values value1 value2 = | T_int i1, T_int i2 -> compare_big_int i1 i2 | T_float f1, T_float f2 -> compare f1 f2 | _ -> - let value1 = value_as_string value1 - and value2 = value_as_string value2 in + let value1 = string_of_variable value1 + and value2 = string_of_variable value2 in compare value1 value2 -and value_as_string = function +and string_of_variable = function | T_bool b -> string_of_bool b | T_string s -> s | T_int i -> string_of_big_int i diff --git a/lib/whenutils.mli b/lib/whenutils.mli index 5f62f5c..1572d02 100644 --- a/lib/whenutils.mli +++ b/lib/whenutils.mli @@ -153,6 +153,8 @@ type variable = | T_float of float (** Typed variable (see also [whenproto.x]) *) +val string_of_variable : variable -> string + val variable_of_rpc : Whenproto_aux.variable -> variable val rpc_of_variable : variable -> Whenproto_aux.variable -- 1.8.3.1