This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-19
Channels
- # aws (9)
- # bangalore-clj (1)
- # beginners (6)
- # cider (17)
- # cljs-dev (9)
- # cljsrn (31)
- # clojure (70)
- # clojure-spec (19)
- # clojurescript (122)
- # cursive (1)
- # datomic (20)
- # dirac (8)
- # fulcro (19)
- # hoplon (25)
- # instaparse (2)
- # lambdaisland (3)
- # luminus (8)
- # lumo (10)
- # om (22)
- # parinfer (25)
- # protorepl (2)
- # re-frame (35)
- # reagent (1)
- # test-check (5)
- # unrepl (6)
And #community-development is still there to discuss alternatives to Slack...
is there a way to force syntax-quote to not resolve a symbol? something like
`(defui ~name static om/IQuery (query [this] '[]))
one way to do it is ~'static
why when I
(->> ["a" "b" "c"]
(fn [coll] (nth coll 2)))
it returns an unapplied function
but
(->> ["a" "b" "c"]
(clojure.string/join))
it applies the join function?I run into this quite often when I want to third
some collection in a this thread last macro.
I guess it has to do with how the ->> macro resolves the fn. if I defn the third
function it works.
->>
just threads stuff into the last position of the forms. So with the second example, it just turns into (clojure.string/join ["a" "b" "c"])
. If you think about the first one then, all its doing is adding more to a (fn ...)
form.
@baritonehands 4clojure also uses clojail and it has very fine grain restrictions for educational purposes
given a vector like this
(def l [1 {:class "first"}
[2 {:class "second"}]])
I would like to be able to add more lists inside the second nested vector
and get something like this
[1 {:class "first"} [2 {:class "second"} [["one"] ["two"]]]]
this actually works (assoc-in l [2 2] [["one"] ["two"]])
but I wonder if there is a better way that doesn't need to hard code indices?
@seancorfield the bot is this one: https://github.com/verma/clj-slackbot. It does use Clojail
@andrea.crotti with specter it's (setval [LAST AFTER-ELEM] [["one"] ["two"]] l)
will perform ~3x faster compared to assoc-in
version
hello 🙂 i read on cascalog introduction that you can Query anything – Query HDFS data, database data, and/or local data
@takis_ you do that by implementing cascading's "Tap" interface
depending on the db an implementation may already exist
i am so new that i don't understand , all i was thinking was using cascalog instead of sql, thank you
cascalog is for batch processing so isn't a drop-in replacement for sql
you could implement a special planner which incorporates the fine-grained query capabilities necessary, but afaik no one's done that yet
is it possible to get an exhaustive list of generated values by spec? similar to excercise, but give you all possible generated values. This would make sense for example for a spec that is #{:a 😛 :c}
I don't quite get what's the desired shape for :prep-tasks in the :uberjar
configuration
if I look at here for example https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L257
it's a bit weird :prep-tasks [["protobuf" "compile"] "javac" "compile"]
at the moment I have
:prep-tasks ["compile"
["cljsbuild" "once" "min"]]
and it works to compile the js, but I have to add garden once
as well nowand can't find how I'm supposed to write it
btw is it possible to share spec between clojurescript and clojure? for clojure I'm using the backported library with 1.8
btw answering myself this seems to work
:prep-tasks ["compile"
["garden" "once"]
["cljsbuild" "once" "min"]]
to compile both the js and the cssstill don't quite get what's the format it wants
and it's quite different from that example in the lein docs, but well as long as it works 😄
@andrea.crotti it accepts either a string (for a command that has no args) or a vector of strings
and the whole thing should be in a vector
so :prep-tasks [["compile"] ["garden" "once"] ["cljsbuild" "once" "min"]]
would behave the same as what you have now
Ah ok I get it now thanks
is there an accepted way of testing if a function/macro in the core namespace is side effecting?
there's no reliable way to know
not programmatically, that is
many but not all things that are not safe in transactions have names ending in !
and the thing that makes them transaction unsafe is some side effect that might be repeated (or a risk of bad state coordination)
@pwrflx not-empty
or seq
, if you want to get a sequence back
you're welcome!
is there some way of using spec's valid?, explain, conform, etc. with a map that contains the keys without namespace? The spec itself I've defined to accept let's say {:mypec/a "a" :myspec/b "b"}, but i have a map that has simply {:a "a" and 😛 "b"} and would like to know if it is valid or not..
however, using the namespaced variants is a lot of extra typing 🙂 also, when deserializing a map from JSON, that is without a namespace by default..
I see 1.9 has a convenience feature for this: https://dev.clojure.org/jira/browse/CLJ-1910