> While the \ syntax will only apply to key paths to begin with, we want to
> look into unifying all unapplied member references under that syntax.
Glad to hear that — I hope the core team will keep the courage to break syntax
from time to time if the change improves the consistency of Swift.
But like anyone else, I prefer breaking changes to happen rarely, and I think
other parts of the language should be taken into account as well.
KVC is nice, but I would really like to see some sort of namespace for querying
and working with "meta-properties":
— function references
— properties
— MemoryLayout<T>
— functions (I'm thinking of stuff like introspection of parameters, and
something like "apply" as a replacement for tuple splat)
— mirrors
— (most likely, I forgot some other possibilities)
There's no concrete vision for such a concept, but I'll just use ":" for
illustration...
let appender: (Array<Int>, Int) -> Void = Array<Int>:methods:append
let someStaticFunction = MyType:classMethods:setGlobalInstance
let sizeProperty = Array:properties:size
let bytesNeeded = Double:memoryLayout.size
if theFunction:signature.parameters = [Int, Int] &&
theFunction:signature.returnType == T {
return theFunction:callWith(myPairOfInt)
}
let parent = Self:superclass
for type in UIViewController:allKnownSubclasses {…
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution