Created
October 4, 2015 03:01
-
-
Save DanielCollins/9327e13deca599c0b817 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
saved_println = println; | |
class WeirdClass { | |
class func println(string:String) { | |
saved_println("---\(string)---") | |
// The above line will call itself i.e. | |
// `WeirdClass.println(string:String)` | |
// instead of system's println | |
// leading to an infinite cycle | |
} | |
init() { | |
WeirdClass.println("init") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment