This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-26
Channels
- # beginners (17)
- # boot (3)
- # cljs-dev (2)
- # cljsrn (3)
- # clojure (52)
- # clojure-austin (1)
- # clojure-poland (4)
- # clojure-russia (29)
- # clojure-spec (25)
- # clojure-uk (5)
- # clojurescript (39)
- # cursive (29)
- # data-science (5)
- # datomic (5)
- # fulcro (21)
- # graphql (1)
- # hoplon (20)
- # off-topic (5)
- # pedestal (1)
- # perun (3)
- # protorepl (2)
- # re-frame (7)
- # ring (1)
- # shadow-cljs (19)
- # unrepl (10)
- # vim (4)
@itaied One difference i know is that a keyword can be used as a function call to a map: ((:foo {:foo :bar}) {:bar :car})
=> :car
hi there, anyone knows, if it is possible to run a function in the repl and get some kind of verbose output of all the steps? something like bash -x for bash-scripts?
one option is tools.trace https://github.com/clojure/tools.trace
there's also profilers - a profiler can show you a lot of information about what ran (available for java or javascript)
alright, thanks, I once saw something that felt easier like this but I hardly recall any name or something (maybe 'analyze'??)
Hey everyone, needing some advice. I plan on learning Clojure, but is it ideal as a first programming language? If so, where would be a good place to start. Some background info: I'm a frontend dev, know HTML, CSS, very little JS. Thanks!
there's a trade-off, racket is designed for learning, and very well suited to be a first language, but clojurescript directly integrates with your existing skills
but clojurescript is designed to be pragmatic for people that know it well, with less consideration to difficulty of learning
and in no way is optimized to be a first language (whereas racket is explicitly designed to be a first language)
Hi, I have a beginner question about spec:
ios:cljs.user=> (require '[clojure.spec.alpha :as s])
ios:cljs.user=> (s/def ::my-int int?)
ios:cljs.user=> (s/def ::my-map (s/keys :req-un [::my-int]))
:cljs.user/my-map
;; But if i try to def the keys, it fails. Why doesn't that substitution work?
ios:cljs.user=> (def the-keys [::my-int])
#'cljs.user/the-keys
ios:cljs.user=> (s/def ::my-map (s/keys :req-un the-keys))
---- Could not Analyze <cljs form> line:1 column:17 ----
Don't know how to create ISeq from: clojure.lang.Symbol
1 (s/def ::my-map (s/keys :req-un the-keys))
^---
---- Analysis Error ----
@hoopes it's because s/def
is a macro and gets the-keys
unevaluated (that is just symbol the-keys
, not the vector).
Your problem is pretty similar to this one: http://increasinglyfunctional.com/2016/07/13/dynamically-generating-clojure-spec-keywords/
yeah, looks like plum.csv/->record