I can go with that: 
      for { name <- enclosingTypeName if name != "package" } yield stripEndingDollar(name)
It's also true that 'a' is not a good variable name.