- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Why use extends to mix in the first trait, with for all others?
Wed, 2009-12-30, 17:33
Hi,
Maybe this has been asked before, then apologize asking once more, but I could not find it in the archives:
Why must we write class C extends T1 with T2 with T3 (with Tn being traits)?
Why must we use extends for the first trait? Wouldn't it be more intuitive to use with for all traits? Like it happens to be the case for dynamic mixins.
Thank you,
Heiko Seeberger
My job: weiglewilczek.com
My blog: heikoseeberger.name
Follow me: twitter.com/hseeberger
OSGi on Scala: scalamodules.org
Lift, the simply functional web framework: liftweb.net
Maybe this has been asked before, then apologize asking once more, but I could not find it in the archives:
Why must we write class C extends T1 with T2 with T3 (with Tn being traits)?
Why must we use extends for the first trait? Wouldn't it be more intuitive to use with for all traits? Like it happens to be the case for dynamic mixins.
Thank you,
Heiko Seeberger
My job: weiglewilczek.com
My blog: heikoseeberger.name
Follow me: twitter.com/hseeberger
OSGi on Scala: scalamodules.org
Lift, the simply functional web framework: liftweb.net
Sat, 2010-01-02, 17:27
#2
Re: Why use extends to mix in the first trait, with for all ot
Think of it as
class C extends (T1 with T2 with T3)
Donna
On Wed, Dec 30, 2009 at 5:33 PM, Heiko Seeberger <heiko.seeberger@googlemail.com> wrote:
class C extends (T1 with T2 with T3)
Donna
On Wed, Dec 30, 2009 at 5:33 PM, Heiko Seeberger <heiko.seeberger@googlemail.com> wrote:
Hi,
Maybe this has been asked before, then apologize asking once more, but I could not find it in the archives:
Why must we write class C extends T1 with T2 with T3 (with Tn being traits)?
Why must we use extends for the first trait? Wouldn't it be more intuitive to use with for all traits? Like it happens to be the case for dynamic mixins.
Thank you,
Heiko Seeberger
My job: weiglewilczek.com
My blog: heikoseeberger.name
Follow me: twitter.com/hseeberger
OSGi on Scala: scalamodules.org
Lift, the simply functional web framework: liftweb.net
2009/12/30 Heiko Seeberger <heiko.seeberger@googlemail.com>
--
Kevin Wright
mail/google talk: kev.lee.wright@googlemail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda