calling multiple functions with same instance in scala

Posted by scout on Stack Overflow See other posts from Stack Overflow or by scout
Published on 2010-04-24T15:34:10Z Indexed on 2010/04/24 15:53 UTC
Read the original article Hit count: 174

Filed under:

is there any way I can achieve the following in scala

with new Car() {
     examineColor
     bargain(300)
     buy
}

instead of

val c = new Car()
c.examineColor
c.bargain(300)
c.buy

© Stack Overflow or respective owner

Related posts about scala