Hi everyone,

I'm reading the excellent 'Functionnal programming for OO programmer' and I 
encounter an issue understanding how the '=' function works.
We have a 'Triangle' structure defined by a map of 'Point's

so a Triangle is like {:point1 {:x 1 :y 1} :point2 {:x 1 :y 1} :point3 {:x 
4 :y 2}}

How does the '=' function actually evaluate the equality between 2 of this 
structure ? 

(= triangle1 triangle2). 

My guess : 

(= triangle1 triangle2) is like 

(= 
    {:point1 {:x 1 :y 1} :point2 {:x 1 :y 1} :point3 {:x 4 :y 2}}
    {:point1 {:x 2 :y 3} :point2 {:x 1 :y 1} :point3 {:x 4 :y 2}})

then the evaluator might apply (= {:point1 {:x 1 :y 1} :point1 {:x 2 :y 
3}), etc for the other points. But this looks like the 'map' function. I 
can't recreate the evaluator steps to get the equality between these 
values. 

Thanks you ! 

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