This new pitch is the best by far. I really like it.
Some minor things I see (but can make peace with):
-
Shouldn't
@Swift.Lazy
beSwift.@Lazy
? -
public(wrapper)
is ambigious for nested wrappers.
public fileprivate(@A) public(@B) var x
is not. -
I (still) would prefer an postfix operator
$
on wrappers to access the underlying storage:@Lazy var foo: Int = 42 foo$.reset(42)
That way, the wrapper's storage appears more like a property of the wrapped value. Within a property wrapper,
self$
could refer to the “enclosing self”. -
Thinking about the future:
@propertyWrapper struct Bla<Value where Value : Hashable> {…}
limits the wrapper to hashable variables?
Once "enclosing self" is there, will
@propertyWrapper struct Bla : Broadcaster {…}
require enclosing self to conform to
Broadcaster
?Shouldn't that be:
@propertyWrapper<Value where Value:Hashable> : Broadcaster struct Bla { … }