Hi,

I'm trying to wrap my head around the role of the #_ macro and how it's
used in core.cljs.

Can some explain, why it is used to prefix (throw.. ) in
(deftype EmptyList [meta]
...
...

IStack
  (-peek [coll] nil)
  (-pop [coll] #_(throw (js/Error. "Can't pop empty list")))

or in
(deftype Vector [meta array]
...
...

IIndexed
  (-nth [coll n]
    (if (and (<= 0 n) (< n (.-length array)))
      (aget array n)
      #_(throw (js/Error. (str "No item " n " in vector of length "
(.-length array))))))

but not in

(deftype Vector [meta array]
...
...

(-pop [coll]
    (if (> (.-length array) 0)
      (let [new-array (aclone array)]
        (. new-array (pop))
        (Vector. meta new-array))
      (throw (js/Error. "Can't pop empty vector"))))


there are other examples at ln 68, ln 127, ln 146 for other forms.

Thx

Las


-- 
László Török

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

Reply via email to