diff --git "a/swift/\360\237\220\224\360\237\222\251.swift" "b/swift/\360\237\220\224\360\237\222\251.swift" new file mode 100644 index 0000000000000000000000000000000000000000..b8cd880f628f363875ff0843ab522778778be788 --- /dev/null +++ "b/swift/\360\237\220\224\360\237\222\251.swift" @@ -0,0 +1,33 @@ +// +// 🐔💩.swift +// + +import Foundation + +class 🐔💩<🐔: Hashable, 💩> { + private var 💩🪣 = [🐔: 💩]() + + func 👈(_ 🐔: 🐔, 💩📦: @escaping ()-> 💩) -> 💩 { + if 💩🪣[🐔] == nil { + 💩🪣[🐔] = 💩📦() + } + return 💩🪣[🐔]! + } + + func 👈(_ 🐔: 🐔) -> 💩? { + return 💩🪣[🐔] + } + + func 👉(_ 🐔: 🐔, _ 💩: 💩) -> 💩 { + 💩🪣[🐔] = 💩 + return 💩 + } + + func 🔄(_ 🐔: 🐔) { + 💩🪣.removeValue(forKey: 🐔) + } + + func 🔄() { + 💩🪣.removeAll() + } +} \ No newline at end of file