OCaml Printf.sprintf
Warum tritt dieses Verhalten auf?
<code># 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 </code>
Ich würde erwarten, dass die String-Verkettung zuerst ausgewertet wird, sodass alles wie gewohnt abläuft. Hat dies mit dem Typsystemtrick zu tun, den Printf einsetzt?