This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-01-04
Channels
- # announcements (5)
- # beginners (205)
- # calva (1)
- # cider (48)
- # cljs-dev (9)
- # clojure (123)
- # clojure-berlin (1)
- # clojure-europe (2)
- # clojure-italy (5)
- # clojure-nl (6)
- # clojure-russia (7)
- # clojure-serbia (1)
- # clojure-spec (8)
- # clojure-uk (33)
- # clojurescript (134)
- # cursive (5)
- # datomic (31)
- # emacs (5)
- # figwheel-main (61)
- # fulcro (10)
- # hyperfiddle (23)
- # jobs-discuss (24)
- # klipse (1)
- # lein-figwheel (3)
- # midje (5)
- # nyc (1)
- # parinfer (2)
- # pathom (14)
- # pedestal (12)
- # re-frame (46)
- # shadow-cljs (24)
- # spacemacs (1)
- # tools-deps (37)
- # vim (4)
- # yada (22)
Is there something like https://github.com/NoRedInk/rspec-retry for clojure.test?
test-refresh?
> Runs previously failing tests first, giving you feedback even quicker.
oh speculatively, yeah i don't know about that
reminds me my question from yesterday: how to resolve a symbol in a macro? answer: (resolve s)
Hello! I'm new here, I posted this message in #beginners but I think it's not the best place... here it goes: We are working on a project were Datomic is being used. We want to analyze de data using ML alorightms (we are data analyst). The thing is we don't event know where to start from!! Could someone point me in any direction?
https://vvvvalvalval.github.io/posts/2016-07-24-datomic-web-app-a-practical-guide.html
@aaguirre in addition to the official datomic docs, this might be helpful summary http://tonsky.me/blog/unofficial-guide-to-datomic-internals/
Slice up history using as-of
and since
https://docs.datomic.com/on-prem/filters.html
If you aren't: http://www.learndatalogtoday.org/
I've seen that there's a way to connect python to datomic with the pydatomic library, which access datomic DBMS via the REST API
@aaguirre the REST API is legacy now, see https://docs.datomic.com/on-prem/rest.html , it's replaced by the Client API
I've read the documentation about it, but I haven't use it. So I wouldnt say Iam "familiar"
reify
can be used to create instances of an interface that close over state
Is there a way to run a clojure -main from outside the project dir like?
cd ~/Projects
clj --dir ~/Projects/find-git-files -m find-git-files.cmdline ./
is there a native way to deploy an uberjar
with lein
? I am trying to do this using a CI Server with lein
installed on it.
I think I figured it out, I can use the -Sdeps flag pointing to the repo to include it in the classpath
clj -Sdeps "{:deps {find-git-remotes {:local/root \"./find-git-remotes\"}}}" -m find-git-remotes
seems to be working but Iโm curious if thereโs a cleaner way to do that.Struggling with lein's uberjar feature, I'm confused why we're not making this not easier for people
Here's my summary:
- most of the time AOT compilation is not desirable
- ns-level forms are executed during AOT compilation, which is confusing
- the only reason why most people use AOT is to set the entry point for the uberjar so that you can java -jar uberjar.jar
instead of the - often superior - java -cp uberjar.jar -m foo.main
The whole situation confuses people:
- people don't understand how gen-class works or why it's necessary
- leiningen warns and unnecessarily suggests that you should set :aot :all
- which doesn't seem like a good default to me
- if you specify :aot [foo.main]
explicitly, that works but due to a bug in lein it compiles the ns twice if you also set :main foo.main
https://github.com/technomancy/leiningen/issues/2521
Really all you want is to generate a class that does the equivalent of these two lines: https://github.com/pesterhazy/lein-aot-example/blob/master/src/foo/main.clj#L7-L8
AIUI most projects will be better off doing that than AOT'ing everything
... given that the Clojure compiler is very fast, it doesn't blur the line between compile time and run time and other issues with AOT'ing
Is there something I'm missing here?
you shouldnโt, at least not in public repos
@lilactown I mean it'll be faster because the compile step isn't needed but is there any advantage to aot'ing other than that?
https://clojure.org/reference/compilation is the bible on it, not whatever lein says
@ghadi that distinction between lib and app code is useful, thanks
by default lein uberjar
doesn't aot, unless you specify :main
or :aot
AFAIK
Wrote this tiny cli tool to update git remotes in all of my projects. However, since I need to write to the file Iโm reading I have to read all the lines of each config file into a seq, process them, then write to the file, move to next file. Is there a way to make that more efficient so I donโt need to load an entire config into memory at once like in line #23?
Oops! Too much context. Boiled the question down and asked in beginners channel where it more likely belongs ๐
@ghadi also thanks for providing the link to the justification for aot'ing. Part of the problem is that leiningen is undocumented, except for the sample project.clj
a better default for lein, I think, would be to do the moral equivalent of lein run
in the uberjar
then users would be able to enable aot'ing as necessary, irrespective of whether they're building an uberjar or not
as it is, lein unnecessarily complects aot'ing and creating uberjars
I figured out how to deploy an uberjar lein do uberjar, deploy [release-repo] [identifer] [version] path/to/uberjar, deploy [release-repo]
@alcamech does the last step do anything?
is that if you want to deploy both a jar and an uberjar?
@noisesmith, Yeah I should have specified that. I wanted to deploy both a jar and an uberjar. I knew how to deploy a jar but not an uberjar.
hmm I noticed that pulling in git dependencies from a deps.edn is not possible when pulling over ssh with an ed25519 keypair. I know thats a limitation of the JGit library (https://bugs.eclipse.org/bugs/show_bug.cgi?id=520927), but shouldnโt that be something that is worth documenting in tools.gitlibโs readme?
Or is there some workaround I am missing
itโs annoying but make sure you use an ssh agent @lennart.buit
you also may have to modify entries within .ssh/config โ specifically remove IdentityFile and let your ssh-agent be smart about it
Right, but only the ed25519 public key is known to GH right.
Hmm maybe I have multiple issues at the same time :โ), eyeballing https://dev.clojure.org/jira/browse/TDEPS-91
yes, thatโs a separate issue
I believe itโs probably something you can get around by editing your ~/.ssh/known_hosts, but certainly not the best
Iโd like to make the switch to just using git but I need to strategize how to best do that without breaking lots of people
right, because that would need git to be explicitly installed right
as in the C binaries + all other git fluff
@alexmiller Maybe attempt to shell out to git
and fallback to jgit if that fails?
well Iโm thinking that we would maybe initially ship with support for both and have some way for user to override
but default logic would probably be git falling back to jgit (as Iโd like to eventually remove jgit entirely)
Hey, all. I'm using deps.edn and building my project on Gitlab. It takes ages because it pulls the clojars deps everytime. How can I find out where on the filesystem those deps end up so that I can cache them?
but if you are downloading stuff from clojars, then it should end up in /.m2 then I would double check your build environment, you building in a container or something and getting a fresh /.m2 everytime, etc
@phil it seems that .m2
is the location they use by default: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/gitlab/ci/templates/Maven.gitlab-ci.yml and caching the dir .m2/repository
should work
no need to brute force.
write the output of find to a file. Then run find again after into a different file.
then do:
vim -d file1 file2
to see the difference between the two ๐
clojure.lang.Keyword is a symbol (that evaluates to a java.lang.Class object) and case test-constants are not evaluated
https://puredanger.github.io/tech.puredanger.com/2010/05/30/learning-clojure-15-case/
When writing websites, is it recommended to stick to standard HTML? Writing with a DSL such as Hiccup seems powerful, but I'm wondering about how I should handle CSS/Javascript then.
For css you might try https://github.com/noprompt/garden if you are looking for a DSL similar to hiccup.
Additionally because hiccup emits HTML, you can just write plain css or js to accompany it and link those resources as you would normally. Otherwise, #garden and #clojurescript are the likely recommendations you will see if you plan on using hiccup to serve templated HTML.
@U1RUG108P is it kosher to have both clojurescript + clojure in same project? I'm using ring + compojure for the backend.
It's perfectly alright to have both clojure and clojurescript in the same project. In fact, clojure supports reader conditionals https://clojure.org/guides/reader_conditionals to maximize code sharing between the two. Many fullstack applications have a considerable amount of code written in .cljc files in order to facilitate this.
If you are using leiningen you might take a look at https://github.com/emezeske/lein-cljsbuild for getting started.
@UA5LS8DMJ I created CHP because it is better to use hiccup instead of HTML https://bitbucket.org/sonwh98/chp/src/master/
@UA5LS8DMJ You have a couple of options. One is to just use the built-in support ala https://github.com/emezeske/lein-cljsbuild/blob/1.1.7/doc/REPL.md. Another is to use middleware and launch a clojurescript repl from your main repl via something like https://github.com/nrepl/piggieback.