On 22 April 2015 at 10:22, Dave Sann <daves...@gmail.com> wrote: > "x is equal to y" to imply "f(x) is equal to f(y)" - can only be true where > a function is really based only on its arguments. I hadn't considered this > before - while it seems simple, it is also a bit subtle. > > for example: seq on a set cannot be pure unless you were to provide an > argument to explicitly specify which order the items should be in. If you do > not do this, the order is defined either by some random interaction of the > of the data and function implementations - that you thought was irrelevant - > or has to be literally picked at random by the implementation. The former of > these will appear to be pure until you hit the special cases. > > I speculate that only functions that retain or reduce the information > content of their inputs can be pure. So if you rearrange or filter or map > they can be pure. But if you implicitly add new information - as (seq set) > does - then they cannot be.
Strachey's paper might be interesting reading on this: http://www.itu.dk/courses/BPRD/E2009/fundamental-1967.pdf /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: mag...@therning.org jabber: mag...@therning.org twitter: magthe http://therning.org/magnus -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.