KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
In python I can do this: def f((a, b)): return a + b d = (1, 2) f(d) Here the passed in tuple is being decomposed while its being passed to f . Right now in scala I am doing this: def f(ab: (Int, Int)): Int = { val (a, b) = ab a + b } val d = (1, 2) f(d) Is there something I can do here so that the decomposition happens while the arguments are passed in? Just curious.
Tags (comma-separated)
Save Edits
Cancel