Could you use Russian Dolls as an analogy? To build a Russian doll (or to build 
middleware) you start out with the smallest doll, and put it inside the second 
smallest, which in turn goes inside the third smallest. When opening the doll 
(calling the function) you start with the largest doll, and open it to reveal 
the second largest, etc. 




Imagine the function as a marble, and Russian Dolls as middleware. To put the 
marble inside the dolls you wrap it in the smallest doll first. To call the 
function (retrieve the marble) you need to open the largest, outermost doll 
first.

On Fri, Oct 2, 2015 at 8:10 PM, Jason Felice <jason.m.fel...@gmail.com>
wrote:

> Why is it so hard to describe to new people?
> I mean, the questions I get are (I understand what's happening here, but I
> can't describe it well):
> 1. If -> threads things first-to-last, why does the middleware run
> last-to-first?
> 2. Why is comp backwards?
> 3. Wait, so how does each wrapper get a second pass at it?
> 4. Why would you do this to me?
> I hope to write a blog or something on this, but I wanted to check in here
> first.  Any ideas on how to talk about this?
> Thanks,
> -Jason
> -- 
> 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.

-- 
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.

Reply via email to