为什么会出现这种情况?
# Printf.sprintf ("Foo %d %s") 2 "bar";;
- : string = "Foo 2 bar"
# Printf.sprintf ("Foo %d" ^ " %s") 2 "bar";;
Printf.sprintf ("Foo %d" ^ " %s") 2 "bar";;
Error: This expression has type string but an expression was expected of type
('a -> 'b -> 'c, unit, string) format =
('a -> 'b -> 'c, unit, string, string, string, string) format6
Run Code Online (Sandbox Code Playgroud)
我希望首先评估字符串连接,所以一切都会正常进行.这与Printf采用的类型系统技巧有关吗?