Hello,

I am so impressed with the Specter lib.  However, I have been having an 
issue with Specter & Clojurescript & couldn't figure out what the issue 
is.  I know I am missing something.  Any help, much appreciated.  The 
details are given below:  

The basic error is "Can't take value of macro cljs.core/fn".  When I remove 
"cljs.core/" before "fn", it works.  What am I missing?  

;==========================================;ON CLJS REPL

(let [mm {:nd
          {:id        #uuid "d444525c-0f14-439c-8158-27d9323db4a2",
           :parent-id #uuid "9ef471f1-a4b9-4539-94d7-f626d0225163",
           :lines     [
                       {:id      #uuid "b7feea61-5352-441f-afb7-88feef6b8684"
                        :details []}
                       ]
           }
          }]
  (sp/transform [:nd :lines com.rpl.specter/ALL (com.rpl.specter/selected? 
(cljs.core/fn [x] (cljs.core/= #uuid"b7feea61-5352-441f-afb7-88feef6b8684" (:id 
x)))) :details]
                (fn [v]
                  (conj v
                        {:id-detail (random-uuid)
                         :schedules []
                         })
                  )
                mm
                )
  )

;;==========================================


----  Compiler Warning on   <cljs form>   line:10  column:77  ----

  Can't take value of macro cljs.core/fn

   6                        :details []}
   7                       ]
   8           }
   9          }]
  10  (sp/transform [:nd :lines com.rpl.specter/ALL 
(com.rpl.specter/selected? (cljs.core/fn [x] (cljs.core/= 
#uuid"b7feea61-5352-441f-afb7-88feef6b8684" (:id x)))) :details]
                                                                            
    ^--- 
  11                (fn [v]
  12                  (conj v
  13                        {:id-detail (random-uuid)
  14                         :schedules []
  15                         })

----  Compiler Warning  ----
----  Could not Analyze  <cljs form>   line:10  column:3  ----

  Unable to resolve var: fn in this context at line 10 <cljs repl>

   1                       (let [mm {:nd
   2          {:id        #uuid "d444525c-0f14-439c-8158-27d9323db4a2",
   3           :parent-id #uuid "9ef471f1-a4b9-4539-94d7-f626d0225163",
   4           :lines     [
   5                       {:id      #uuid 
"b7feea61-5352-441f-afb7-88feef6b8684"
   6                        :details []}
   7                       ]
   8           }
   9          }]
  10  (sp/transform [:nd :lines com.rpl.specter/ALL 
(com.rpl.specter/selected? (cljs.core/fn [x] (cljs.core/= 
#uuid"b7feea61-5352-441f-afb7-88feef6b8684" (:id x)))) :details]
      ^--- 
  11                (fn [v]
  12                  (conj v
  13                        {:id-detail (random-uuid)
  14                         :schedules []
  15                         })
  16                  )
  17                mm
  18                )
  19  )

----  Analysis Error  ----
=> nil
Thanks for the responses.

--Hari

-- 
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 https://groups.google.com/group/clojurescript.

Reply via email to