KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
scala coalesces multiple function call parameters into a Tuple -- can this be disabled? discusses Scala creating a tuple to bind to one arg function. This results in scala> println(1, 2) (1,2) The answer says that the compiler allows one arg functions to be called with no parens, so that logically this is a call to println with a tuple. But println cannot be called with a single tuple parameter scala> val t = (1, 2) t: (Int, Int) = (1,2) scala> println t <console>:6: error: value t is not a member of Unit println t ^ so something else is going on. Why are tuples special here?
Tags (comma-separated)
Save Edits
Cancel