This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-04
Channels
- # aleph (3)
- # beginners (37)
- # boot (45)
- # carry (1)
- # cljsrn (15)
- # clojure (78)
- # clojure-austin (2)
- # clojure-brasil (10)
- # clojure-czech (3)
- # clojure-dev (12)
- # clojure-dusseldorf (31)
- # clojure-hamburg (2)
- # clojure-italy (4)
- # clojure-poland (2)
- # clojure-russia (37)
- # clojure-spec (25)
- # clojure-uk (30)
- # clojurescript (160)
- # cursive (40)
- # data-science (1)
- # datomic (31)
- # emacs (7)
- # figwheel (4)
- # hoplon (73)
- # leiningen (1)
- # liberator (5)
- # luminus (7)
- # numerical-computing (1)
- # off-topic (31)
- # om (89)
- # onyx (66)
- # proton (5)
- # protorepl (1)
- # re-frame (18)
- # reagent (2)
- # ring (2)
- # spacemacs (1)
- # untangled (93)
- # vim (19)
- # yada (67)
as-str
seems to be doing the trick, because it just allows this string to become an HTML string. Makes sense.
So many similar ways 🙂
@a.espolov I don’t know if you’re asking something beyond the standard answer?
(assoc the-map :abc/xyz some-value)
@a.espolov - that’s a new bit of syntax: #:amount{:abc 123} is the same thing as {:amount/abc 123}
http://dev.clojure.org/jira/browse/CLJ-1910 is the right one i think
docs for the new namespace map syntax are at http://clojure.org/reference/reader#_maps
and support for the new namespace key destructuring at http://clojure.org/reference/special_forms#_map_binding_destructuring
I'm finding it a bit fiddly to come up with good unique clojure.spec keywords when defining structured data. ::blah and ::my-alias/blah are helpful. I think it'd be useful to have ::anything/blah expand to :current-ns.anything/blah too.
i’ve found myself wanting the same behavior, @olivergeorge
So I know there’s a good way of handling macros that are like (defmacro do-stuff [config & body] …)
but I can’t for the life of me remember what that pattern is or where I saw it. The issue is that config might actually be part of the body if it’s not a map or something that evals to a map, so I need to check that and maybe integrate it into the body…
it evals to a sequence, often you see `(fn ~@body) if you want to splice the parenthesis.
Hello, do files which get reponsed via ring have to be in the resources path? Or how is it possible to get them from a location on the server?
@danielgrosse are you serving the files with ring? From you question sounds like you would be asking for something like http://www.facebook.com/../../../../usr/mark_zuckerberg/email_archives/nsa 🙂
@hlolli I just discovered, I could use (file "path/to/file.jpg")
as response. So this is what I wanted.
Given that I need this in a macro (knowing this is not a problem in a defn), would this considered to be a bug or is there a way to avoid no matching ctor. compare this
(defn fn-returning-fn [a b]
(fn [] (+ a b)))
(defmacro loop-in-macro [v]
(loop [i v
m {}]
(if (empty? i)
(prn m)
(recur (next i)
(assoc m
(ffirst i)
(eval `~(second (peek i))))))))
(loop-in-macro [[:a (fn-returning-fn 2 2)]])
=> prints: {:a #function[panaeolus.track-fn/fn-returning-fn/fn--21678]}
to this where I want to return the map
(defn fn-returning-fn [a b]
(fn [] (+ a b)))
(defmacro loop-in-macro [v]
(loop [i v
m {}]
(if (empty? i)
m
(recur (next i)
(assoc m
(ffirst i)
(eval `~(second (peek i))))))))
(loop-in-macro [[:a (fn-returning-fn 2 2)]])
=> No matching ctor found for class
panaeolus.track_fn$fn_returning_fn$fn__21710
(added: Im looking to get the same return value from the second example as is printed as side-effect from the first example).Anyone know why the default-fixture in clojure.test remains private? Seems like it would be useful when composing fixtures.
how can I reload my java code in a mixed clojure/java project? I tried reimport from https://github.com/zcaudate/vinyasa but ended up in a dependency hell with the current versions, now the project has been deleted. any other alternatives?
OSGi doesn’t play very nicely with Clojure by default and the clojure.osgi project has gone unmaintained for quite some time now.
@kaosko there was a project that allowed you to do exactly that
now that I see the vinyasa's changelog, I see he moved from pomegranate to wu.kong. they use a different version of aether which was causing a problem for me. I dropped back to using 0.4.3 vinyasa and I can confirm reimport is working now (lost the pull but oh well)
Here’s the most recently maintained clojure.osgi.utils as of the last time I checked: https://github.com/pmoriarty/clojure-osgi-utils
oh thanks @pesterhazy , haven't seen it, must try virgil right now. that's what I want (if it works...)
@pesterhazy Thanks; that’s nice.
perfect @pesterhazy, virgil works as expected. love you 🙂
correct
I'm using multimethods for command dispatch and would like to document the different commands. I guess I could do this with the methods wrapping individual functions, but that seems like unnecessary duplication.
you could use the same dispatch values as keys in a docstring map
that keeps it programmatic
or else use inline comments
or write very simple code, so you don’t need docstrings -grin-
I appreciate the simple code idea 🙂 Sometimes it's hard to be succinct in naming attempting to explicitly describe what's going on 🙂
sure. if you needed programmatic access to docstrings, you could use the dispatch values you set up for your defmethods as keys in map, with values being your docstrings
(def yay-doc {:one “Totally serious work stuff here.”})
(defmethod yay :one [_ arg])
I don’t want to have a flamewar here but is there some definitive place where the clojure indentation style is defined? I am particularly interested of what is the consensus for indentation of threading macros.
you’d still need to do extra work to get at the doc strings, but at least it’s deterministic
cider lines the statements up vertically
whatever format you can automate into your editor wins, in my book
if you’re manually indenting code, you’re wasting precious time! 🙂
for accessing ftp?
@miner’s https://github.com/miner/clj-ftp looks decent
it wraps the Apache stuff, which about the best you’re going to do with minimal effort
@robert-stuttaford yes, thanks, that is what I was looking for
milestones, the smart project anagemet lib in #clojure, with #clojurescript support hits 0.2.0 ! https://github.com/turbopape/milestones
A friend is facing problems with clojure on windows. Everything looks like it's installed correctly and lein reply on a fresh project works but changing the project to alpha13 causes a host of spec errors. No other changes were made on a new project. Any ideas?