Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • Thanks! Good demonstration with the compare function. I guess in practice, I'd be fine calling that one impure then... Commented Jan 24, 2021 at 21:09
  • The Wikipedia article you quoted already notes: "Some authors, particularly from the imperative language community, use the term "pure" for all functions that just have the above property 2", which is still quite useful. So as long as you don't mutate the mutable argument (and no one else does) your function is still pure. Commented Jan 24, 2021 at 21:15
  • Also the part that refers to "mutable reference arguments" has been added in these edits and is not backed by a quotation from literate. There is also quite some discussion on the talk page. Commented Jan 24, 2021 at 21:26