This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-09-20
Channels
I've been happy with automatic test runners like Quickie and lein-test-refresh, which re-run tests when the files change. However, I'd like to be able to execute a function at the beginning of each test run. Normally you'd wrap something around run-all-tests
, but with these test runner plugins, I suspect I'd have to fork and give them the ability to read a pre-test command from project.clj, which seems like a hassle. Is there a workaround?
@andrewboltachev: take a look at s3 private wagon. It's a very lightweight Maven repo hosted on S3. It also helps if you want to do CI, as your deps are accessible from The Cloud
@amacdougall: Expectations has this feature. You could also look at just using clojure.test fixtures possibly?
@andrewboltachev: let me know if you get stuck, I'd like to make the onboarding flow a bit easier.
Is there any way to get a copy of the events in a channel in core.async when that channel is being used for putting and taking already by a library? otherwise I’ll have to fork the library to insert a mult in the middle.
If I make a library called blah and that library can be used with, re-frame but also without, so I don’t want blah to pull re-frame in, should I provide a separate one, called blah-re-frame that depends on blah and re-frame and provides the helpers to use blah with re-frame? or should I use :provided?
silly question.... I have a map {:a [1 2 3 4]} and I would like to conj something onto the vector in that map... but which function to call?
@pjagielski: thanks!
I get a java.lang.UnsupportedOperationException: count not supported on this type: HeapByteBuffer]
exception. How can I implement count
for HeapByteBuffer
so that it will be globally used across my program?
@nooga you’d need to extend the Counted
protocol to HeapByteBuffer (or perhaps to one of it’s superclasses?)
I meant interface
It’s 1:30 am 😪
go to sleep @danielcompton
hi, any idea how I can do something like this with Compojure: (UPDATE "/v1/phonebook/:id{[0-9]+}" [id {body :body}]
@bhagany: yep https://github.com/technomancy/leiningen/blob/master/doc/PLUGINS.md#1x-compatibility, https://github.com/technomancy/leiningen/blob/master/doc/PROFILES.md#default-profiles (Ctrl+F for dev-resources)
@danielcompton: thanks!!
@bhauman np, btw sorry for all the ridiculous figwheel bugs I’ve been posting
@danielcompton: no worries
I get null pointer exception somewhere in http://gloss.io/encode and it seems there’s no way to find out what causes it
hah I’ve just taken printf debugging to extreme and dumped state + arguments to edn file inside wiiiide exception handler
@bbloom: I have a fipp question. I’m interested in using it to pprint things in the Cursive REPL. Is it possible to make fipp streaming, i.e. print what it can once it knows the layout for a chunk of the doc?
(disclaimer: That was a lazyweb question, I did dig into the code, but some time ago).
it’s cool - now i’m aware of your interest. feel free to lazy web some more, if it helps you make cursive pretty print awesome-like
Thanks, I’ll try it out and ping with questions. I have to change the printing since I’ll be outputting to an IntelliJ document rather than actually printing to stdout, but that should be straightforward.
@cfleming: you should only need to implement the visitor protocol. impl should be tiny: https://github.com/brandonbloom/fipp/blob/master/src/fipp/edn.cljc
@bbloom: Thanks, I’ll check it out. I have my own lexer/parser which allows me to “read” unreadable forms containing #<things>
So I’ll have to build the formatting doc myself, but that looks simple following the EDN example
ednize is for converting jvm/js objects to edn (including the tagged literall form) and then the edn.cljc file prints that closed set of types
That’s why I asked about it being incremental - hopefully I can make the whole thing totally streaming, which will be nice for users who insist on passing back huge data structures
fipp’s edn and clojure printers are totally streaming - see discussion here: https://github.com/brandonbloom/fipp/issues/21
in particular, note that pudget’s default config will sort unbounded things before passing them to fipp, so pudget won’t be streaming
Right, ideally I’d integrate some of Cursive’s formatting smarts, but it’s hard to know when a particular form is code rather than data, and since Cursive has an interactive macroexpander I suspect that it’s nearly all data anyway.
cfleming: well i’m super interested to see if fipp works out for you - lmk how it goes, i’ll do what i can to help
IntelliJ also does some nice things like lining up map values, but that’s not a linear-time op I suspect, certainly their impl isn’t.
@bbloom: Cool, will let you know when I get to it. It’ll be a while, I just saw you were online in #C03S1L9DN and thought I’d ask.
Well, the map alignment thing requires you to have the whole map in memory to calculate the width of the keys.
They use an iterative constraint algorithm for their formatting, which is flexible but not great for online use.
Well, consider the map key/value problem. You calculate the key and value widths (need the whole map) and then you figure out that the width of the whole map is way over your allotted width. You then need to break lines in your keys, your values, or both, trying to find the best way to get the total width down.
ooh you mean they use that approach w/ some abstraction over the code, which they then use to drive where the chars go
Yeah, basically you break the code into blocks, and express constraints on those blocks (all these ones must align, etc).
although even macro expansions could use a more complex layout algorithm — for small expansions
I use that engine for macro expansions, that works ok (and will work much better, when I have time to tweak it).
Even for big ones. I mean I haven’t tried it on core.async, but their engine formats enormous files fine.
I’ll also have to track the type of the elements since I need to say “style this like a keyword” or whatever.
otherwise, you can just hack the printer to return a seq - the very last step just does (run! print ...)
if you get it working w/ a hacked version & have a good idea of how to parameterize the existing impl, lmk
i don’t think anything looks at pass, so it could be arbitrary data if the last step wasn’t print
Ok, nice, I’ll use [:pass :keyword]
or something similar to print the next thing like a keyword.