This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-06
Channels
- # admin-announcements (17)
- # beginners (78)
- # boot (162)
- # braid-chat (2)
- # cider (20)
- # cljs-dev (9)
- # cljsjs (41)
- # cljsrn (17)
- # clojure (98)
- # clojure-austin (5)
- # clojure-brasil (1)
- # clojure-dusseldorf (1)
- # clojure-greece (1)
- # clojure-ireland (2)
- # clojure-italy (1)
- # clojure-japan (5)
- # clojure-russia (128)
- # clojure-uk (2)
- # clojurescript (29)
- # core-async (1)
- # core-logic (7)
- # css (1)
- # cursive (12)
- # datomic (18)
- # devcards (1)
- # dirac (6)
- # emacs (31)
- # funcool (28)
- # hoplon (208)
- # jaunt (66)
- # jobs (1)
- # juxt (6)
- # lein-figwheel (14)
- # off-topic (9)
- # om (83)
- # om-next (6)
- # onyx (63)
- # overtone (1)
- # parinfer (2)
- # protorepl (23)
- # re-frame (27)
- # reagent (14)
- # ring-swagger (8)
- # slack-help (2)
- # spacemacs (1)
- # untangled (56)
@lvh some of the changes in yesql 0.5.x prompted me to create HugSQL: http://www.hugsql.org
@lvh: I’m on yesql 0.5.2 and using a reloaded pattern; I’m not having any trouble doing (defqueries “sql/queries.sql”)
and then passing the connection like (get-user {:id 2} {:connection conn})
hi @nav, check out my library: https://github.com/nathell/skyscraper/
can someone think of a way to make compojure match routes that don't have an extension?
@nav: there's also this: https://github.com/swannodette/enlive-tutorial
plexus: that feature toggle lib looks neat, providing a cookie-toggle implementation out of the box would probably be useful for lots of people
@glenjamin: this first release is just laying the groundwork, it's not very feature-rich yet. PR's are welcome though 😉
But why? Why is it that the backtick has two features, namespacing stuff and allowing unquote, but you have to use both?
@martinklepsch: you should be able to do something with the regex support
@plexus: yeah that /:path
approach helps!
@sveri: (moving conversation here) Pennon is mostly intended for features that are under development. It allows decoupling deploying to server from switching on new features
that said it's pretty generic, you can think of it as a rule-based system for turning features on/off. How you set up the rules is up to you
@grav: you're not forced to use unquote, and you can escape the auto-qualifying bit by using ~'foo
@bronsa, you’re right there. But I have to do ~’
quite a bit in eg datomic queries, if I want to use unquote
Hey guys I am trying to destructure the value of map being passed into a function to a vector. So for instance if I have a map {:group1-value "abc" :group2-value "cde" :group3-value "fgh" :group4-value "ghi" :group5-value "dddd”} and I want to passed it to (defn x [destructuring here]) any ideas how I would do it
@john.carnell: If the map contains always the same keys you could do (defn x [{:keys [foo bar baz]}]...
@john.carnell: what result do you want to get?
I am trying to pull the values out of map into vecotr
vectior
In the function I want to take the values and join them with a “-"
(defn- build-pairing-token-string "Build the final pairing token string that will be returned ot the customer." [{:keys [group1-value group2-value group3-value group4-value group5-value]}] (str group1-value "-" group2-value "-" group3-value "-" group4-value "-" group5-value))
I want to eliminiate the (str join) and see if I can destructure into a vector and then use the join function
to join them together
I want to keep the order of the keys
listed in the {:keys}
cool let me play with it
(defn- build-pairing-token-string
"Build the final pairing token string that will be returned ot the customer."
[m]
(clojure.string/join "-" (map m [:group1-value :group2-value :group3-value :group4-value :group5-value])))
Thanks guys
@syzer: all depends on what you're doing. If you're not targeting browsers it makes more sense to use Clojure
you could build server-side stuff in ClojureScript as well and e.g. run it in node or rhino, but it's not that compelling an option at the moment
you could run bootstrapped clojurescript without a jvm, but it's not intended for production use, and you would do without the optimizations that the Google Closure compile does (which also needs a JVM)
is there shorthand for calling a quoted fn? (let [f '(+ 2 3 4)] (apply (resolve (first f)) (rest f)))
seems crufty
but reimplementing eval in terms of apply is probably also a code smell 😆 you'll have a poor man's eval which can evaluate functions but not special forms
Does anyone know how to eval
a sexp where the symbols in the sexp may not be vars, but also let bindings? I seem to recall figuring this out once but can’t recall the details.
That jibes with my recollection
Dear JVM people, please help me understand why (bit-and (byte -114) (short 0xFF))
has type Long, i.e., why bitwise-and of 16-bit and 8-bit values returns 64-bit value? I'm trying to decide if this expected (i.e., JVM internally upcasts all arguments to bitwise operators to 64-bit) or if it's something I'd doing wrong, because ideally I'd like to get 16-bits out of that bit-and
but if it's always going to be 64-bit then I might as well leave it as such (unless memory becomes an issue)
@fasiha: the JVM only has either 32 or 64 bit numerics, short/byte/char are still 32bit. as to Why you're getting back a Long -- clojure defaults to long/doubles and has little to no support for byte/short/int/float operations
My IDE just crashed, but the nrepl is still going strong. Is there a way to get the history?
is there a term for a pair of numbers that have the same absolute value but one is negative and one is positive?
so -1 and 1
2 and -2
i’m trying to appropriately name my (brute force) function to check
@jrotenberg: > Two numbers that have the same magnitude but are opposite in signs are called Opposite Numbers.
A vector pair of additive inverses?
opposite seemed too obvious
but there you go
it certainly doesn't come from core.async, but there are other ways to do things async, and you could write your own thing called '<?' on top of core.async
(let [ch (chan)]
(go (>! ch (Exception. “boom”)))
(go (<? ch))) ;; Raises “boom” exception inside go
Do most people not use go
's automatically returned channel? I use them a lot but most examples I read don't, so I sometimes wonder if I'm being unidiomatic
well, the built in returned channel can only have one item put on it once, where most interesting stuff you do with queues, you put many things on it over time
So I have what might be sort of a remedial question here - if I'm in the REPL, in the directory with the relevant project, and do (use 'some-namespace.core) I should have access to all the stuff I've defined in that core.clj, correct? Assuming it doesn't grumble about not finding the namespace, at least.
For context, I'm trying to run though the ring documentation, and though I can get a handler running by defining it in the REPL, I get an "Unable to resolve symbol" error if I just name the handler I defined in my core.clj
@hiredman Oh, there's totally a lot of cases where using the returned channel makes no sense. I just always use them when they would work. But even in examples with only one item I pretty much always use the built-in one. It might be that examples don't use it because it's a little less obvious. But there might be other reasons why it works but is unwise