Created
March 30, 2021 23:56
-
-
Save ProfFan/3758bb671a6f3a423a57c284165cf3b5 to your computer and use it in GitHub Desktop.
swift.swift
This file contains 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
let π = true; | |
class π€£ { | |
let π¦: Int; | |
init() { | |
self.π¦ = 1; | |
} | |
init(_ π¦: Int) { | |
self.π¦ = π¦ | |
} | |
} | |
extension π€£: CustomDebugStringConvertible { | |
var debugDescription: String { | |
return String(repeating: "π€£ ", count: self.π¦) | |
} | |
} | |
infix operator β: MultiplicationPrecedence | |
extension π€£ { | |
static func β (_ lhs: π€£, _ rhs: π€£) -> π€£ { | |
return π€£(lhs.π¦ + rhs.π¦) | |
} | |
} | |
let πΉ = π€£() | |
print("!π = \(!π)") | |
print("\(πΉ β πΉ β πΉ β πΉ β πΉ)") | |
// Result: | |
// !π = false | |
// π€£ π€£ π€£ π€£ π€£ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Love it :)