KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Why does this behavior occur? # 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 I would expect that the string concatenation would be evaluated first, so everything will proceed as normal. Does this have to do with the type system trickery that Printf employs?
Tags (comma-separated)
Save Edits
Cancel