> On Dec 21, 2015, at 12:20 PM, T.J. Usiyan via swift-evolution
> <[email protected]> wrote:
>
> I have been thinking about this proposal since the list opened up. I think
> that @read(none|only) should be considered as an alternative. Just as in
> clang and the optimizer annotations @read(none) would be the attribute
> described and @read(only) could read global variables but could not write. Is
> it possible to generate a runtime error if we guarantee that function A is
> pure, only to call it and 'find out' that it isn't? If we can, then do try
> syntax could be considered.
Another approach here is an effects system. If a pure function were spelled
`(T) => U`, then `readonly` could be expressed as `(T) reads => U`, and (T) ->
U could remain as a synonym for (T) reads, writes => U, in the spirit of
encouraging immutability without punishing mutability.
-Joe
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution