KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Being new to Scala (2.9.1), I have a List[Event] and would like to copy it into a Queue[Event] , but the following Syntax yields a Queue[List[Event]] instead: val eventQueue = Queue(events) For some reason, the following works: val eventQueue = Queue(events : _*) But I would like to understand what it does, and why it works? I already looked at the signature of the Queue.apply function: def apply[A](elems: A*) And I understand why the first attempt doesn't work, but what's the meaning of the second one? What is : , and _* in this case, and why doesn't the apply function just take an Iterable[A] ?
Tags (comma-separated)
Save Edits
Cancel