On Saturday, December 17, 2016 at 3:54:07 PM UTC-6, Rafo Ufoun wrote:
>
> Is there a special check when the equality is asked on map ?
>

= does different things for different kinds of values, so in some sense 
yes. The implementation for maps (written in Java) is here:

https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/APersistentMap.java#L73-L94

 

> I thought the evaluator evaluate all the expression the same way , by 
> substituting each expression contained in the list to other evaluators.
>

This expression will first evaluate triangle1 and triangle2 to the maps (as 
you said), then invoke = with those two maps.
 

> In the book, the author tells the substitution rule for function 
> evaluation is responsible for no distinction between pointer equality and 
> content equality. I can't understand this sentence.
>

If a value is immutable, then you can compare pointers to determine whether 
they are the same *identical* value (because if it's immutable it cannot be 
different in the two versions). But if it's not the same pointer, then you 
need to compare those values more deeply further to determine if their 
contents are equal. So I guess I'd say the book is not giving you the full 
picture here.
 

> Thank you for your answer though
>
> Le samedi 17 décembre 2016 15:48:58 UTC-5, Alex Miller a écrit :
>>
>> Map equality is checked by verifying that the two maps have the same set 
>> of keys and that each key is mapped to = values.
>
>

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