Hi Johannes, I've run into this before. Here is a ticket [1] and some context and a potential workaround [2]:
[1] http://dev.clojure.org/jira/browse/CLJ-1206 [2] https://groups.google.com/d/msg/clojure/BZwinR2zNgU/8HGOgzOxzosJ -Jason On Thursday, May 5, 2016 at 1:32:21 AM UTC+7, Johannes wrote: > > Hi! > > I have a function f- defined using a local function f which uses a local > var v: > user> (def f- (let [v 1 > f (fn [x] v)] f)) > ;; => #'user/f- > > Putting f- in a map > user> {:d f-} > ;; => {:d #function[user/fn--13335/f--13336]} > all is as expected. But giving the map as argument to eval > user> (eval {:d f-}) > this error message appear: > IllegalArgumentException No matching ctor found for class > user$fn__13335$f__13336 clojure.lang.Reflector.invokeConstructor > (Reflector.java:163) > > This problem doesn't arise if the local function f doesn't use v: > user> (def f- (let [v 1 > f (fn [x] x)] f)) > ;; => #'user/f- > user> (eval {:d f-}) > ;; => {:d #function[user/fn--13345/f--13346]} > > Is there any explanation for this behavior? > > Johannes > -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.