Avatar
Kishikawa Katsumi 8/15/2018 12:12 PM
https://forums.swift.org/t/isnotempty-on-array/15228/25 これオシャレで良いなあと思いました。
As you might surmise, I don't have any specific generic algorithm an Emptiable protocol would enable. I find it interesting for two reasons: Clarity: I find "isInhabited" to be much clearer and easier to reason about than "isEmpty == false" & "!isEmpty" (& even "isNonEmpty...
12:13 PM
@inverse(isNotEmpty) var isEmpty: Bool { ... } ^ ここのところ。