Skip to content

Instantly share code, notes, and snippets.

@DanielCollins
Created October 4, 2015 03:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DanielCollins/9327e13deca599c0b817 to your computer and use it in GitHub Desktop.
Save DanielCollins/9327e13deca599c0b817 to your computer and use it in GitHub Desktop.
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