def doSomething(in: int) = {println("Doing something with "+in)} l.foreach(doSomething)