This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-18
Channels
- # adventofcode (62)
- # aws (5)
- # beginners (59)
- # calva (63)
- # cider (26)
- # cljdoc (1)
- # cljsrn (22)
- # clojure (99)
- # clojure-austin (1)
- # clojure-dev (19)
- # clojure-europe (4)
- # clojure-hamburg (2)
- # clojure-italy (3)
- # clojure-nl (23)
- # clojure-spec (2)
- # clojure-uk (85)
- # clojurescript (41)
- # core-async (17)
- # cursive (20)
- # data-science (11)
- # datascript (2)
- # datomic (31)
- # emacs (7)
- # figwheel (28)
- # figwheel-main (12)
- # graphql (2)
- # hyperfiddle (3)
- # juxt (1)
- # kaocha (2)
- # leiningen (5)
- # nrepl (13)
- # off-topic (45)
- # pathom (13)
- # pedestal (11)
- # re-frame (20)
- # reagent (10)
- # shadow-cljs (92)
- # spacemacs (9)
- # sql (39)
- # tools-deps (32)
- # unrepl (3)
It very well might make sense for one or more third-party REPLs to have code to try to avoid consuming some part of the input after an error occurs. The potentially tricky part is determining where in the input to start consuming input again.
does pREPL run into the same problem? I don't know what pREPL solves that nREPL doesn't (I've only taken a cursory look) but I thought part of its intent was a more structure input/output to avoid such confusion
prepl
is still going to have the same underlying issue which is that if reading code hits a parse error, the unread code is essentially unknowable, so it can only start to read again at the point where the parse error caused reading to leave off...
As Andy said above, the hard part of this problem is determining what unread input to throw away before parsing should resume. You could probably come up with some heuristics but pretty much any strategy you pick is going to be "wrong" in some situations...
@seancorfield gotcha, thanks. I could see a way of structuring the inputs to make it possible by allowing the inclusion of, basically, instructions/hints on this, but it would be a lot to include for that kind of thing without adding a lot of overhead
Should I use clj
or clojure
?
Today I saw:
Please install rlwrap for command editing or use "clojure" instead.
So there is a difference.
hmm what is preferred way to download deps only? like lein deps
? For example I want deps for clj -A:test:test-once
, but I don’t want to run it. I need it to prepare docker mages.
~/L/M/c/s/P/f/master clj -Sforce -A:test:test-once 3789ms Tue Dec 18 13:05:41 2018
WARNING: var: form-validator.core/show-all is not public at line 147 /Users/kwladyka/Library/Mobile Documents/com~apple~CloudDocs/storage/Projects/form-validator/master/test/form_validator/core_test.cljs
Testing form-validator.core-test
Ran 3 tests containing 20 assertions.
0 failures, 0 errors.
hmm it actually run testsI want to run clojure
for a few deps.edn
only to download dependecies. So I have foo.edn, bar.edn etc. How to run clojure
with custom named deps.edn
?
There is no option for that
If you want to just download deps, you can use -Spath to just build the classpath without starting Clojure
What about the best way to download deps? clojure -Spath -A:fig
? -Stree
? Something different?
Either -Spath or -Stree will download without starting Clojure
Heya, not sure if this is a dumb question - in cljs, (keyword :a :b)
gives :a/b
where as in Clojure you get an error. Would it be a breaking change for Clojure for it to behave the same way?
Ah would it come under this ticket: https://dev.clojure.org/jira/browse/CLJ-2123?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel#issue-tabs
no, that doesn’t make much sense to me
I don’t get how you go from :a as name a into a qualifier in :a/b - that seems quite weird to me
Ah ok, so if anything, it's more likely to be removed from cljs
Ah yeah, looks like the commit that did in cljs this was making keyword more restrictive; it was accepting more previously which was resulting in different hashcodes https://dev.clojure.org/jira/browse/CLJS-1779?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel#issue-tabs https://github.com/clojure/clojurescript/commit/5ac08cc0d5524e429200b1f9e68d27a5c07d5c3f
Wasn't there a way to type hint directly on a Java interop form? e.g. (^java.io.PrintWriter .println err "foo")
you want the hint on the object (err)
only way to do what? back up…
heh... In this case it was supposed to be *err*
, and so I have to introduce a let just to type hint, and I swear I remembered there was a way to do that without the let, but I'm thinking maybe just ghost memory?
(.println ^java.io.PrintWriter *err* "foo")
?
maybe you misunderstood what I was suggesting above…
{github-kwladyka/form-validator {:git/url "
- Can I set it to always pull the last commit? Without sha
? Probably wouldn’t work. I need it for testing purpose in cicd.
the intent is that a release points to a concrete commit so we don’t have support for tracking branches etc (which would also break cp caching, etc)
the underlying tools.gitlibs library does support this (has broader intent), so it’s pretty easy to write a line or two of code that would tell you what the latest sha is
One silly question: How do I suppress error logging when testing a case of error? I have several "SEVERE:" in my test outputs that are really bothering me.
are these things being printed out to the REPL or are you running your tests cases from the command line?
There are logging libraries that let you configure which level you'd like to print at: https://github.com/ptaoussanis/timbre If you are running from the command line, then could use grep to exclude certain things from being output (might be able to do this with a REPL as well, but I've never tried it).
the log file is there if you need to investigate a test failure, but you don't end up with logging in your test run
for example https://github.com/hiredman/raft/tree/master/test has a logback.xml in the tests directory which sets up logging for running tests
I came from elixir and when executing lein test
I would like to not print logs from some few tests (like "@tag capture_log: true" in elixir).
Usually test runners have some tooling to capture stdout.
For Kaocha it's described here: https://cljdoc.org/d/lambdaisland/kaocha/0.0-319/doc/3-configuration
is there a function that I can give a path to a file and it will give me the corresponding namespace? e.g.
(x "project/core_test.clj")
;; => 'project.core-test
@hiredman the issue with logging to a file is that in CI you don't usually get to look at that file after your tests failed
while also not perfect I like stdout to be printed if a test fails
at my last job we had jenkins setup, jenkins ran each build in a workspace, workspaces were saved and archived, and that included the log files
yeah that's nice indeed — but also requires more setup 🙂
for other ci environments you can treat logs like another build artifact and export them to where ever you export those (s3)
Say you’re looking at the implementation of a popular, open-source Clojure library. One function looks pretty meaty and I think it can be broken up into several, smaller functions. Would it be acceptable to make a PR to address that or does it come off as rude or nitpicky? The choice could have been made for performance reasons but I can’t quite tell.
There's only one way to find out - open a PR and be humble and clear about why you think this is a good idea. Worst that can happen is your PR gets closed.
I see your point, but I chose to raise a question as an issue in a respectful manner to identify the problem and a proposed solution. I mentioned I’m happy to implement it and provided some thinking behind how I would. I think this has the advantage that I don’t have to invest time into it only to find out it got rejected and they don’t have to read through a PR if they’re not into the idea to begin with.
Big meaty functions are par for the course in my experience. Often my problem with them isn’t so much their size but their lack respect for the potential contributor. If you’re planning to make a contribution in that regard be sure that you’re improving the overall semantics of the code and not just parameterizing.
True. I tried to focus on a problem that the meatiness causes — Which is that I can’t reuse the pieces of it I need to solve my problem and have to copy parts of it even though I’m already dependent on the library to begin with.
You might want to ask the author/maintainer of the library their thoughts on the matter, before opening a PR.
Good idea. My instinct says to respectfully create an issue about how breaking it up would be allow other people to reuse the pieces without having to reinvent the wheel. I think that will frame it more positively towards a problem doing so will solve.
Yeah, I'll often create an issue with a subject "Question: ..." and ask for their opinion on approaches, and see how the land lies before I invest in creating a PR.
Thanks