I think what you're seeing here makes sense.

On Sunday, April 12, 2015 at 3:39:15 PM UTC-5, whodidthis wrote:
>
> Are there any thoughts on code like this:
>
> #_
>

This says to ignore the next read form....
 

> #?(:cljs (def unrelated-1 nil))
>

This evaluates to *nothing*, ie nothing is read, so it is not ignored by 
the #_.
 

> #?(:cljs (def unrelated-2 nil))
> #?(:cljs (def unrelated-3 nil))
>

These also read as *nothing*.
 

> #?(:clj (def n 10))
>

This *is* read, but ignored per the prior #_ 

#?(:clj (defn num [] n))
> ; compile on clj =>RuntimeException: Unable to resolve symbol: n
>

And then this makes sense.
 

>
> I guess it's fine if it continues to work that way but I can imagine it 
> being a little surprising from time to time heh
>

Conditional reading is definitely something to be careful about - I think 
in this case you are combining two types of conditional reading so be 
doubly careful. :) 

To get the effect you want in this, using #_ *inside* the reader 
conditional would work:

#?(:cljs #_(def unrelated-1 nil))

 

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