views:

101

answers:

1

Language FAQ says

import scala.collection.mutable.{_, Map => _, Set => _}

should import all classes from package scala.collection.mutable, except Map and Set. But it gives me this error:

error: '}' expected but ',' found.
       import scala.collection.mutable.{_, Map => _, Set => _}

Is there still a way to do this?

+9  A: 

the _ have to be put at the end not at the beginning:

Exclude Map and Set from the import

import scala.collection.mutable.{Map => _, Set => _, _}

Exclude Set and rename Map to ScalaMutableMap

import scala.collection.mutable.{Map=>ScalaMutableMap, Set => _, _}

Detailed info into the Scala Refererence page 47, paragraph 4.7

Patrick