On abstractions and pure functions

81 views
Skip to first unread message

Erik Assum

unread,
Sep 29, 2017, 9:06:28 AM9/29/17
to Elements of Clojure
I'm somewhere in the chapter on abstractions (rather specifically on page 83), and a thought struck me.

You're writing about the assumptions we make about our environment, and it strikes me that a pure 
function seems to make no assumptions about its environment, since it only relates to it input params?

Don't know if it means anything, but thought I'd mention it any way.

Erik.

Zach Tellman

unread,
Sep 29, 2017, 11:09:29 AM9/29/17
to Erik Assum, Elements of Clojure
Hey Erik,

The environment is also what invokes the function, and any in Clojure any function other than `identity` makes some assumptions about what it's being passed.  I know that defining the environment as "everything else" is a little amorphous, if that wasn't clear I should think about how to make it more so.

Zach

--
You received this message because you are subscribed to the Google Groups "Elements of Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elements-of-clo...@googlegroups.com.
To post to this group, send email to elements-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elements-of-clojure/0bc33a04-00bc-4cc7-80c5-c6dca7dfcd6a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages