Advertisement
Guest User

Untitled

a guest
Mar 10th, 2015
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let printf : string -> int -> int -> ('a, unit, string, unit) format4 -> 'a =
  2.     let start_time = Sys.time () in
  3.     (fun brick_name brick_verb verb message ->
  4.      Printf.ksprintf
  5.        (fun s ->
  6.         if true
  7.         then Printf.printf "[%s][%.3f]%s" brick_name start_time s else ())
  8.        message);;
  9.               val printf : string -> int -> int -> ('_a, unit, string, unit) format4 -> '_a =
  10.   <fun>
  11. # printf "hi" 5 1 "Bonjour %s !" "tobias";;
  12. [hi][0.061]Bonjour tobias !- : unit = ()
  13. # printf "hi" 5 1 "Bonjour %d !" 5;;
  14. Characters 16-30:
  15.   printf "hi" 5 1 "Bonjour %d !" 5;;
  16.                   ^^^^^^^^^^^^^^
  17. Error: This expression has type
  18.          (string -> unit, string -> unit) CamlinternalFormatBasics.precision
  19.        but an expression was expected of type
  20.          (string -> unit, int -> 'a) CamlinternalFormatBasics.precision
  21.        Type string is not compatible with type int
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement