(let [els (.getElementsByTagName js/document "body") el-1 (aget els 0)
el-2 el-1] (set! (.-display (.-style el-1)) "none") (.dir js/console
(.-display (.-style el-2
) )) )

So besides the fun fact that running this on
http://himera.herokuapp.com/index.html makes the whole thing disappear, it
shows one of two scenarios I'm aware of where Immutability breaks down when
the value is itself not immutable. In other words, define el-2 as el-1
using immutables makes no sense given that the value they refer to is
itself mutable (a dom element) so el-2's style.display property is glued to
el-1's style.display property since they, despite being immutable, refer to
the same mutable value.

A similar scenario is when some-function mutates a global atom. Defining
some-other-function as some-function would then mean that both functions
mutate the same value in the atom, which could easily lead to trouble
whereas if the functions were pure then immutability works great and we
could define functions by other functions and not worry about state
corruption.

If someone could share some insight it might help me understand things more
clearly I would definitely appreciate it! :)

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to