I think this protocol and its subscript need a better name. From a user of the 
class point of view, the subscript looks like you can retrieve the members of 
the class, whereas in reality you'll only get the ones you have manually 
implemented. Even methods and properties having the `dynamic` attribute won't 
be available, even though the subscript name would suggest that.

I would propose adding the word `supplemental`to the subscript name and the 
name of the protocol to make it clearer that this is only for adding members 
that are not declared in the class (including the `dynamic` ones).

As in `SupplementalDynamicMemberLookupProtocol` and `supplementalDynamicMember` 
for the subscript.


> Le 15 nov. 2017 à 2:29, Chris Lattner via swift-evolution 
> <swift-evolution@swift.org> a écrit :
> 
> protocol DynamicMemberLookupProtocol {
>   associatedtype DynamicMemberLookupValue
> 
>   subscript(dynamicMember name: String) -> DynamicMemberLookupValue { get set 
> }
> }
> 

-- 
Michel Fortin
https://michelf.ca

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to