Created
November 3, 2011 21:47
-
-
Save hodzanassredin/1337887 to your computer and use it in GitHub Desktop.
c_ polity via mixins
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 main | |
| trait PolicyPrint{ | |
| def out(str: String) {println(str)} | |
| } | |
| trait PolicyPrintNothing{ | |
| def out(str: String) {} | |
| } | |
| trait PolicyENLanguage{ | |
| def str() = "Hello" | |
| } | |
| trait PolicyFILanguage{ | |
| def str() = "Terve" | |
| } | |
| trait PolicyHost{ | |
| def out(str: String) | |
| def str():String | |
| def dosmth { | |
| out(str()); | |
| } | |
| } | |
| class PrintFI extends PolicyHost with PolicyFILanguage with PolicyPrint | |
| object HelloWorld { | |
| def main(args: Array[String]) { | |
| val p = new PrintFI() | |
| p.dosmth | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment