And a related bug/quirk: I had had

(defn- remm
  "Remainder of a modulo b; unlike (rem a b) result is in [0,b) even if a is
   negative."
  ([a b]
    (let [r (rem a b)]
      (if (< r 0)
        (+ r b)
        r))))

and evaluated

(defn- remm
  "Remainder of a modulo b; unlike (rem a b) result is in [0,b) even if a is
   negative."
  (^long [^long a ^long b]
    (let [r (rem a b)]
      (if (< r 0)
        (+ r b)
        r))))

in the same namespace. After that, I ran a test from the namespace and
got a very weird failure:

#<ClassCastException java.lang.ClassCastException: thingy.core$remm
cannot be cast to clojure.lang.IFn$LLO>

Reloading the full namespace fixed it.

It looks like there's a failure to be as dynamic as people expect,
here; if a function is modified in a way that changes the hinting on
it, its callers apparently need to be recompiled or they'll crash
rather than transparently start using the new version. I'm not sure if
this is a bug or an expected limitation, though; unlike the above,
where an error message appeared that clearly was not applicable in
that situation.

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