I'm more interested in the compiler being able to detect obvious (to
it, not me) errors.

Example 1:
========
user=> (await1 (binding [*warn-on-reflection* true ] (send (agent 0) #
(if *warn-on-reflection* (inc %) (dec %)))))
#<ag...@238a47: -1>
user=> (await1 (send (agent 0) #(binding [*warn-on-reflection* true]
(if *warn-on-reflection* (inc %) (dec %)))))
#<ag...@da18ac: 1>

It looks to be a detectable thing.


Example 2:
========

(binding [*warn-on-reflection* true]
  (map #(if *warn-on-reflection* (+ %) (- %)) [1 2 3 4 5]))
(-1 -2 -3 -4 -5)

(map #(let [*warn-on-reflection* true]
        (if *warn-on-reflection* (+ %) (- %)))
     [1 2 3 4 5]))
(1 2 3 4 5)


It seems to me that there is a 'right' way and a 'wrong' way - so long
as I get an electric shock for doing it wrong, I'm not too concerned
about how it looks (which to me is fine anyway). Please correct me if
I'm missing something important here.

So to me the big question is - can the compiler detect things like
this? Where to start if I want to implement such a feature?



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