Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let printf : string -> int -> int -> ('a, unit, string, unit) format4 -> 'a =
- let start_time = Sys.time () in
- (fun brick_name brick_verb verb message ->
- Printf.ksprintf
- (fun s ->
- if true
- then Printf.printf "[%s][%.3f]%s" brick_name start_time s else ())
- message);;
- val printf : string -> int -> int -> ('_a, unit, string, unit) format4 -> '_a =
- <fun>
- # printf "hi" 5 1 "Bonjour %s !" "tobias";;
- [hi][0.061]Bonjour tobias !- : unit = ()
- # printf "hi" 5 1 "Bonjour %d !" 5;;
- Characters 16-30:
- printf "hi" 5 1 "Bonjour %d !" 5;;
- ^^^^^^^^^^^^^^
- Error: This expression has type
- (string -> unit, string -> unit) CamlinternalFormatBasics.precision
- but an expression was expected of type
- (string -> unit, int -> 'a) CamlinternalFormatBasics.precision
- Type string is not compatible with type int
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement