This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-30
Channels
- # aws (2)
- # beginners (139)
- # boot (9)
- # cider (1)
- # clara (2)
- # cljs-dev (35)
- # cljsrn (3)
- # clojure (112)
- # clojure-dusseldorf (9)
- # clojure-greece (6)
- # clojure-italy (13)
- # clojure-russia (160)
- # clojure-seattle-old (1)
- # clojure-uk (79)
- # clojurescript (85)
- # clojutre (1)
- # community-development (11)
- # core-async (32)
- # cryogen (2)
- # cursive (5)
- # data-science (16)
- # datomic (2)
- # events (1)
- # fulcro (29)
- # funcool (1)
- # graphql (4)
- # immutant (5)
- # instaparse (20)
- # jobs (2)
- # juxt (6)
- # leiningen (11)
- # luminus (21)
- # lumo (1)
- # off-topic (7)
- # onyx (20)
- # parinfer (33)
- # pedestal (4)
- # re-frame (41)
- # reagent (34)
- # ring-swagger (14)
- # rum (5)
- # spacemacs (9)
- # specter (11)
- # sql (14)
- # test-check (3)
- # yada (20)
Morning beautiful people
morning all
@conan back in '14 we tried using Datomic for geosearches. Elasticsearch was a much better fit here.
got to stop... procrastinating.... on talk preparation... time for coffee and dedication
Aren't you presenting this weekend? That should be enough reason to get cracking đ
mÄnmÄn
Any recommendations on passing a Clojure cmd-line tool a string? I would expect this to work: java -jar target/uberjar/bar-0.1.0-SNAPSHOT-standalone.jar "foo"
, but nothing is returned?
@jonpither yeah, datomic + elasticsearch is lovely
(defn -main
"I don't do a whole lot ... yet."
[& args]
(prn args))
/tmp/foo
⯠java -jar target/uberjar/foo-0.1.0-SNAPSHOT-standalone.jar
nil
/tmp/foo
⯠java -jar target/uberjar/foo-0.1.0-SNAPSHOT-standalone.jar foo
("foo")
clojure.tools.cli/parse-opts
might give you a clue https://github.com/clojure/tools.cli
my main:
(defn -main [database]
(prn (query-nhm-api database "Archaeopteryx")))
database
is a number of defâed objects in the same namespace. Perhaps that is my issue?this works from cmd line if I hard code the entry for database, but I would like to get to a point where database and the string (âArchaeopteryxâ) are both args
> database
is a number of defâed objects in the same namespace. Perhaps that is my issue? (edited)
Clojure can handle shadowing just fine, e.g.:
(let [db 10]
(let [db 20]
db))
;; => 20
but @dominicm I donât think the cmd line knows what I mean when I give it an argument for database. For example java -jar target/uberjar/dippi-0.1.0-SNAPSHOT-standalone.jar collection-specimens
collection-specimens
is a defâed object in the namespace, but why would the cmd line know what/where that is?
this: java -jar target/uberjar/dippi-0.1.0-SNAPSHOT-standalone.jar collection-specimens
doesnât return anything from cmd line, but works fine from the REPL (`(-main collection-specimens)`)
You want collection-specimens at the CLI to refer to dippi.core/collection-specimens ?
(ns foo.core
(:gen-class))
(def thing "some-value")
(defn -main
"I don't do a whole lot ... yet."
[lookup]
(prn @(resolve (symbol lookup))))
/tmp/foo
⯠java -jar target/uberjar/foo-0.1.0-SNAPSHOT-standalone.jar foo.core/thing
"some-value"
However, don't think this is generally a good idea, recommend you do something like this:
(def dbs
{"collect-speciments" collect-specimens})
For security reasons & such.Thanks a lot @dominicm got it working with @(resolve (symbol lookup))
just need to make it more secure as you suggest đ
woah, did not expect this. If you do (prn *ns*)
inside of -main
, you get clojure.core
yeah, it seems to be the very top level. I had an issue using *ns*
for some error logging and ended up using a macro similar to the ones in clojure/tools.logging
I'll have to look at how they work. I'm guessing they work because they expand ns at macro time instead of at runtime.
If you use:
(defn -main
"I don't do a whole lot ... yet."
[lookup]
(prn @(ns-resolve (find-ns 'foo.core) (symbol lookup))))
Then you can do
⯠java -jar target/uberjar/foo-0.1.0-SNAPSHOT-standalone.jar thing
(without the ns)mroninggg
Question for the day, as this is bothering me right now: How do people treat their git commits? Seems to be a couple of approaches:
* commits like s
, stuff
, implements X
, does X & Y & Z
* commits are "Rewrite X\n\nOld X sucked because A, B, C (See GH-10). New X uses floobits to ensure that fellanges are entirely secure at all times."
I find myself doing the latter form, and avoiding the "X & Y & Z" via careful use of Magit to make it "X" "Y" "Z"
i tend to try to follow the advice from https://chris.beams.io/posts/git-commit/
Re-posting here in case anyone knows: >Are there any online resources / books that would teach about the underlying architecture of Clojure? I'm looking for things that would help me to understand how Clojure actually works (code compilation/execution, behind the scenes processes, caveats with things like macros, etc.) as opposed to things like syntax and results of running code.
hey @yogidevbear, no resources of that kind in a single place AFAIK
there are several talks on the topic (one is mine) about following the journey of an s-expression into the compiler down to bytecode
That sounds perfect
Someone else did suggest https://www.youtube.com/watch?v=6DaBmz_6y0s&index=9&list=WL
yeah, another is https://vimeo.com/100518965
Complete agree with that sentiment
A nice experience to try is to put a breakpoint in intellij somewhere in LispReader and fire up the repl in debug mode to follow step by step
Are there any videos/posts on that (intellij/LispReader/repl in debug mode)?
That would be amazing!
i could do a talk about how the internals of clojure work at some london meetup in the future, if there's interest
afternoon