[swift-evolution] [Proposal idea] Support for pure functions

Andrew Trick atrick at apple.com
Thu Jan 14 11:56:20 CST 2016


> On Jan 14, 2016, at 4:22 AM, Michel Fortin <michel.fortin at michelf.ca> wrote:
> 
> In D, for template functions, the pure attribute is deduced from the function's body. It'd be nice to have deduced purity so you don't have to figure out those conditional purity requirements for every function. 
> 
> Deduced purity should probably not extend automatically to other resilience domains though, because it provides a guaranty that might not apply to future versions of that function. So you still need a way to annotate.

That’s right. This proposal is really about 
- introducing API support so we can optimize across resilience
- allowing annotation of low level routines, like sortInPlace, that the compiler can’t figure out

Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160114/3be1a1c7/attachment.html>


More information about the swift-evolution mailing list