This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-11-13
Channels
- # admin-announcements (6)
- # beginners (19)
- # boot (1)
- # cbus (2)
- # cider (3)
- # clara (24)
- # cljs-dev (4)
- # cljsrn (18)
- # clojure (168)
- # clojure-boston (1)
- # clojure-dev (55)
- # clojure-russia (199)
- # clojure-sg (2)
- # clojurescript (38)
- # clojurex (1)
- # core-async (15)
- # css (16)
- # cursive (62)
- # datomic (23)
- # editors-rus (17)
- # events (3)
- # funcool (1)
- # hoplon (360)
- # ldnclj (37)
- # lein-figwheel (11)
- # leiningen (1)
- # nginx (1)
- # off-topic (13)
- # om (361)
- # onyx (1)
- # re-frame (56)
- # reagent (24)
- # robots (1)
- # spacemacs (46)
- # yada (9)
What's the reasoning behind using require
outside of the ns
macro?
to cause loading and/or to modify the current namespace's symbol resolution
probably mostly done at the repl, but there are some use cases in normal project code too
Do you have an example when it would be a good use case in normal project code? Having a hard time reasoning about when it would be the right solution.
if you have code that dynamically loads a namespace based on configuration
https://github.com/clojure/clojure/blob/master/src/clj/clojure/core/server.clj#L63 is an example in the 1.8 socket server that will load the namespace of the provided accept function
Thanks!
There's probably a more idiomatic way to keep constants like file paths, strings for the Ui and such than to def them in a 'constant' namespace, right? Does anyone have input for me there?
can anyone recommend either a) a good tutorial on java string formatting or b) a library that exposes a better string-formatting api?
Not really a tutorial, but I found the JavaDocs for Formatter to be pretty comprehensive - https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html#syntax
Which is what the built in format
function in Clojure uses
Anything in particular you are trying to do / having trouble with?
i’ve been thinking about nanogenmo and maybe trying to do some fun string formatting tricks
but i’m used to python’s string formatting, which seems a lot nicer to me, at least based on my admittedly-scant experience with java's
@swizzard: I don't know. Which other ways are there?
@meikemertsch: i don’t know! 😞