struct PredicateBindings
<aside> π‘ Predicateμ μ λ ₯λ λ³μκ°μ λ³μν€-κ° λμ λ리 ννλ‘ λ§€νν, μΌμ’ μ νκ²½λ³μ λͺ¨μ.
<aside> <img src="/icons/list_blue.svg" alt="/icons/list_blue.svg" width="40px" /> λͺ©μ°¨
</aside>
</aside>
Swiftμ κΈ°λ³Έ Predicate
νμ
λ§μ μ¬μ©ν κ²½μ°μλ ν΄λΉ νμ
μ λν΄ μ νμκ° μλ€. 컀μ€ν
Predicate ꡬνμ λ΄λΆμ μΌλ‘ μ¬μ©λλ€.
νμ¬λ‘μλ 컀μ€ν predicate νμ μ μκ³Ό κ΄λ ¨λ proposal λ° APIκ° μ‘΄μ¬νμ§ μμ§λ§, Predicate νμ μ ꡬνμ μ€νμμ€λ‘ 곡κ°λμ΄ μλ€.
github.com/apple/swift-foundation: Predicate
λ§μ½ 컀μ€ν predicate νμ μ ꡬννλ € νλ€λ©΄, ν΄λΉ νμ μ ν΅ν΄ λͺ¨λ λ³μκ°μ΄ κ΄λ¦¬λλλ‘ ν΄μΌ νλ€. λ€μ μ¬μ© λ°©λ²μ μ°Έκ³ νμ.
// κ°μ λμ
λ리 λμ λ°°μ΄μ μ μ₯νλ€(λ΄λΆ μμλ κ±°μ λλΆλΆμ κ²½μ°μ λ§€μ° μ μΌλ―λ‘, μ΄λ₯Ό ν΅ν΄ heap allocation λ° hashing μ€λ²ν€λλ₯Ό κ°μμν¨λ€)
private var storage: [(id: PredicateExpressions.VariableID, value: Any)]
init<each T>(_ value: repeat (PredicateExpressions.Variable<each T>, each T))
subscript<T>(variable: PredicateExpressions.Variable<T>) -> T? { get set }
func binding<T>(_ variable: PredicateExpressions.Variable<T>, to value: T) -> PredicateBindings