List Info

Thread: Fwd: "ocaml_beginners"::[] How to printf a ref of a bool?




Fwd: "ocaml_beginners"::[] How to printf a ref of a bool?
country flaguser name
United States
2007-05-01 19:28:59

it works in interactive mode. but got some problems in file driver.ml

printf "%B" ! ast

error info:
File "driver.ml ", line 62, characters 8-12:
This expression has type
(bool -> 'a -> 'b -> 'c, out_channel, unit, 'a -> 'b -> 'c) format4
but is here used with type
(bool -> 'a -> 'b -> 'c, out_channel, unit) format =
(bool -> 'a -> 'b -> 'c, out_channel, unit, unit) format4
"
let ast = ref false
let print_ast() = !ast

On 5/1/07, Fabrice Marchant < fabrice.marchant%40orange.fr">fabrice.marchantorange.fr> wrote:
&gt;
> > How to printf a ref of a bool? like ast and print_ast() here.
&gt; >
>; > print a ref of bool let ast = ref false
&gt; > let print_ast() = !ast
>; >
>; > printf "%B&quot; ast;;
&gt;
> Maybe with a "!&quot; before ast :
> Printf.printf "%B&quot; !ast;;
&gt;
>
>

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )