| It's an interesting
question. I am not sure whether "most" functions can be pure under the
definition I gave in that blog post, but likely a great many. There is also some question of whether we should have purity at all. pcwalton and I have been thinking about an alternative which would allow us to remove the pure qualifier altogether, though unfortunately it's less expressive. The basic idea is that instead of requiring purity, the borrow checker would only permit calls to functions that cannot access mutable state. This can be guaranteed through a combination of a Const bound and by checking the types of values provided as a parameter. This has the advantage that all fn items fit this definition, presuming that their parameters are of appropriate type. I hope to get around to writing this up as a blog post trying to explore the areas where the newer approach would fall short of purity. Niko
|
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev

