On 5 November 2017 at 00:57, Didier <[email protected]> wrote:

> I think I'm firstly confused by the use of the word object. I'm guessing
> in this case it refers to things that implement IObj?
>

It means an object on the JVM.


> I'm then confused by what is meant that an object with different meta is a
> different object, if they are still equal?
>

Two objects can be equal, yet refer to two different locations in memory.
For example:

  user=> (def a (java.net.URI. "/foo"))
  #'user/a
  user=> (def b (java.net.URI. "/foo"))
  #'user/b

Here are two objects that are equal, but they each have a different
location in memory:

  user=> a
  #object[java.net.URI 0xf20da5a "/foo"]
  user=> b
  #object[java.net.URI 0x290826b7 "/foo"]

When two symbols reference the same object in memory, we say they are
*identical*. In this case, a and b are *equal* but not *identical*.

  user=> (identical? a b)
  false
  user=> (= a b)
  true

I'm guessing it means that if you change the meta on an IObj, you get a
> copy?
>

It's more accurate to say that an IObj's metadata cannot be changed; you
can only create a new IObj with new metadata.

And then I'm confused as to why that would cause lazy-seq to realize their
> head? Can't two lazy-seq share the same head?
>

This I'm not too certain about. It may just be an implementation detail.

-- 
James Reeves
booleanknot.com

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to