The use case I have is the HTML fixer-upper that I'm writing. I need to covert a list of elements that are returned by my conquer function into a varargs group that is passed to the Elem() constructor:
val childrenList : List[Node] = conquer(remainText) Elem(null, name, attrs, TopScope, childrenList : _*)
I don't truly understand the Scala magic that is at work here. If I recall, any operator ending in : is right associative, but I think a single : is a slightly different case that's a built-in, but even so, it seems a bit magical. Should probably look it up.
Thanks for this! I needed this today, and I must say it is a bit odd. I was expecting something like [A]* or something along those lines, which is used for specifying the type in a definition (i.e. Person*).
ReplyDelete