tag:blogger.com,1999:blog-31592724.post7032734989629005459..comments2023-05-12T07:33:40.325-04:00Comments on Marcus Christie's Blog: Scala: Understanding the self type annotation and how it relates to the Cake PatternMarcus Christiehttp://www.blogger.com/profile/02331634762593140064noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-31592724.post-86121704285751469372016-03-28T11:39:23.003-04:002016-03-28T11:39:23.003-04:00Order matters
trait Bar {
this: Baz =>
def...Order matters<br /><br />trait Bar {<br /> this: Baz =><br /> def greet = println(greeting)<br />}<br /><br />trait Baz {<br /> this: Qux =><br /> val greeting = "hello " + to<br />}<br /><br />trait Qux {<br /> val to = "world"<br />}<br /><br />object TryOutFoo extends App {<br /> object Foo extends Qux with Baz with Bar<br /> Foo.greet// hello world<br /><br /> object Foo1 extends Bar with Baz with Qux<br /> Foo1.greet //hello null<br />}laiboonhhttps://www.blogger.com/profile/13873592302693863506noreply@blogger.comtag:blogger.com,1999:blog-31592724.post-11612452403608300782015-03-21T13:51:54.793-04:002015-03-21T13:51:54.793-04:00I like your approach to the explanation of the Cak...I like your approach to the explanation of the Cake pattern and the self type annotation. Most of the blog posts / tutorials on this are way to obscure or complicated. Great job!Jodihttps://www.blogger.com/profile/03580586927447808084noreply@blogger.com