This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-07
Channels
- # beginners (41)
- # boot (38)
- # cider (17)
- # cljs-dev (52)
- # cljsjs (3)
- # clojure (200)
- # clojure-italy (8)
- # clojure-russia (50)
- # clojure-spec (28)
- # clojure-uk (45)
- # clojurescript (28)
- # core-async (9)
- # core-matrix (2)
- # cursive (16)
- # datascript (15)
- # datomic (50)
- # dirac (5)
- # emacs (20)
- # figwheel (8)
- # flambo (2)
- # hoplon (10)
- # incanter (1)
- # jobs (1)
- # leiningen (2)
- # lumo (26)
- # mount (171)
- # off-topic (22)
- # om (54)
- # onyx (2)
- # pedestal (27)
- # re-frame (10)
- # reagent (12)
- # ring (27)
- # ring-swagger (3)
- # rum (2)
- # slack-help (1)
- # spacemacs (134)
- # specter (6)
- # sql (15)
- # testing (20)
- # uncomplicate (5)
- # unrepl (49)
- # untangled (9)
- # yada (29)
@mroerni fmap! also accepts a (primitive) function whose first argument is a long -> that'll be the index of an element of a vector (column or row). Unfortunately, there is no way to provide both i and j... If you absolutely need both i and j, use (entry i j) in a loop...
@mroerni and the third option is to see whether you need those indexes at all, or there is some linear algebra function that can do what you need.
@mroerni just checked this. the previous is how fold works. fmap doesn't give the function access to the indexes. You'll have to loop yourself and use (entry! i j val).
@mroerni I think I have solution to what you want to do. 0.10.0-SNAPSHOT will have additional alter
method variant that will alter all elements using a function, and feed indexes to this function if applicable. Watch the github repo and it will be there in a couple of days, since it is not difficult to implement.