Created
August 16, 2010 04:21
-
-
Save lamdor/526402 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package hello { | |
| abstract class Sayer { | |
| def say(): String | |
| } | |
| object SayHello extends Sayer { | |
| def say = "Hello" | |
| } | |
| package object api { | |
| type Talker = Sayer | |
| val HelloTalker = SayHello | |
| } | |
| } | |
| package myClient { | |
| object Main extends Application { | |
| // println(SayHello.say) | |
| import hello.api._ | |
| object FastTalker extends Talker { | |
| def say = "really fast" | |
| } | |
| HelloTalker.say | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment