On Wed, Oct 24, 2012 at 2:05 PM, Patrick Walton <[email protected]> wrote: > On 10/24/12 12:50 PM, Niko Matsakis wrote: >> >> Patrick— >> >> I think what you're saying -1 on here is some kind of purity inference? >> That doesn't seem to be what was proposed, though. >> >> In fact, I *believe* Nathan's point was merely that it's useful >> sometimes to document "purity" in order to express the intention of the >> API, and that in those cases it's nice to write it explicitly, just as >> it's nice to have the types of parameters and return types written >> explicitly. This does not seem to be in disagreement with what you said >> about reserving the right to become impure. > > > Oh, in that case I totally agree. I thought Nathan was asking for the purity > specified in the function signature to always match the inferred purity of > the function--in particular, for the compiler to enforce that a pure > function is never marked impure. That was what I was objecting to. If I > misinterpreted I apologize. >
Patrick interpreted my suggestion correctly, but on second thought I withdraw it. Requiring inferred-pure functions to be explicitly marked pure is inconvenient, just as if a type may be inferred as ~[u8] but the API designer may want to declare it ~[mut u8] for future flexibility. > > Patrick > Nathan > _______________________________________________ > Rust-dev mailing list > [email protected] > https://mail.mozilla.org/listinfo/rust-dev _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
