This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-11
Channels
- # aleph (3)
- # beginners (42)
- # cider (219)
- # cljs-dev (39)
- # cljsjs (19)
- # cljsrn (3)
- # clojure (97)
- # clojure-canada (12)
- # clojure-dev (14)
- # clojure-italy (5)
- # clojure-nl (4)
- # clojure-russia (1)
- # clojure-spec (3)
- # clojure-uk (140)
- # clojurescript (52)
- # clojutre (2)
- # cursive (2)
- # datomic (29)
- # docs (1)
- # duct (13)
- # emacs (19)
- # fulcro (8)
- # funcool (2)
- # graphql (26)
- # hyperfiddle (1)
- # luminus (9)
- # nyc (7)
- # off-topic (26)
- # om (21)
- # onyx (19)
- # overtone (1)
- # pedestal (4)
- # re-frame (10)
- # reagent (109)
- # ring (5)
- # rum (15)
- # shadow-cljs (120)
- # spacemacs (22)
- # specter (7)
- # vim (10)
@klaus.azesberger you may want to try adding expound
to your project; it'll make those giant spec errors much more readable.
https://github.com/bhb/expound
Hello everybody, a beginner question regarding clojurescript tooling: What is the difference between figwheel and figwheel-main? Which one would you recommend? Thanks in advance!
Pick up figwheel if you are using leiningen or boot for building cljs. figwheel-main is mostly for tools.deps utility which is new and still in alpha
Ok, thanks for the advice 🙂 Is there any overview on best practice configuration of leiningen for cljs dev and build? I mean apart from the various templates (eg reagent-figwheel, figwheel, mies) which differ quite alot in structure and complexity?
There is no silver bullet, unfortunately. I can suggest to play with compiler options and find out the best configuration for yourself. Templates can be a good starting point on that way) For myself I usually starting with basic minimum (just cljs-build) and add complex tools only when I have some problems, like need to reload webpage often to reload source code or need to connect my IDE with running program.
It is not the simplest way but as long as you following it will give you a lot in terms of understanding what is going on and how to solve it
maybe doing it manually is the best path anyways. thanks a lot!
mind blank: I got a function that initializes a certain specialized data structure, and a function that adds an element to it. Any reason not to bundle them into an object? or what would be the most idiomatic way to provide users with an easy way to use instances of this duo?
I would look to bundle them into an object myself. If it’s a persistent data structure, implementing IPersistentCollection would be a way to hook into familiar clojure.core fns.
Any recommendation from within this group of alternative paths for implementing an interface? https://clojure.org/reference/java_interop#_implementing_interfaces_and_extending_classes
Thanks @donaldball anyway, is there a purely functional counterpart to this?
I guess not; just making all those functions that work on my specialized data structure sit in their own namespace, leaving it to users to abuse them on the wrong data types
Question: Is there a way I can pattern match on map keys? For example, say I have a map with many different keys and I'd like to filter out some of those based on their key-name. Something along the lines of (dissoc my-map (regex that matches on key name))
Another way to put it is that I want to filter out any keys that may contain the word password
or phrase pass
.
I would do this via reduce-kv
- there's no solution that isn't a linear scan on all keys
what's the type of the key? if it's a keyword name
gives you a string not including (optional) namespace
str
gives you the actual string representation of course
I was able to get it done using that. But I don't understand why I get a vector back?
you can use into
with the filter
transducer here
(into {} (filter f?) m)
where f? is your fn above
note that m is outside the filter call
the other way works too, but filter's transducer is preferable in cases like this where it can be used
it directly filters the values going into the hash-map, instead of making a lazy-seq and then putting that into a hash-map
also (filter f)
can be composed directly with other transformations
but maybe you don't need this in #beginners 😄
How will this code look like on Clojure
const func = (x, y) => f => f(x, y)
?that fn could equivalently be #(% x y)
Hello everyone, I need help in printing the cell data of column A and Column B in REPL. How can I print it? This is what I coded till now: (defn sheet "Return all the sheet [sheet] from file [file-path]" [file-path sheet-name] (->> (load-workbook file-path) (select-sheet sheet-name) (select-columns {:A :col1, :B :col2}) ) )
@rachna.rajput99 If you’d like a nice tabular printout clojure.pprint/print-table
is nice.