Fork me on GitHub

Oh, can you not do (range 13 0) ?


(range 13 0 -1)

Alex Miller (Clojure team)04:05:22

Default step is 1

👍 1

I guess it would slow it down to be smart enough to detect ascending/descending, make sense.


I'm imagining a tool for clojure(script) that captures all the transitive execution log from a certain entry point. Imagine, what debux does, but across multiple functions. The execution data could then be queried by specialized interfaces to help with debugging. Think execution as data. Being sexps trees, we also have a fairly natural coordinate system to put the traces in, and than we could have very smart interfaces like this: in our code, put the cursor on a subform in our function, and get back the traces for that subform. debux seems the closest thing that comes to mind, if instead of printing out the information it would collect it in an appropriate data structure. And if it had better extension to multiple functions. Such a tool would also sidestep the problem that it's difficult to have a debugger for cljs like the emacs debugger, due to the single-threaded nature of js. As I'm sure I'm not the first to think about this, what should I look at to find tools with similar ideas or problems I'm not yet seeing?


Is something like Postmortem or omni-trace close to what you have in mind? •


@U0508956F they are very close, I guess omni-trace would be there if it supported cljs, and if it integrated debux for inner-form tracing in a more principled way (allowing multiple inner traces, for example). Or it would be the same if postmortem (thanks btw 🙏 ) had an instrumentation that captures not only the :args and :ret for a function, but also spied with a unique key on every subform (in the spirit of debux .


The crux of it is using a natural coordinate system for code execution (I'll detail better what I mean in case it's unclear). Does any of this make sense?


@meditans clojure-lsp has something like a call tree (ingoing and outgoing) based on clj-kondo's analysis data. would that be interesting to look at?


That's an invaluable feature, but it doesn't collect runtime data (right?). I think it could be interesting as part of the interface for querying, I'll have to think more about it


It does not collect runtime data, correct. It's based on static analysis

🙌 1
Martynas M15:05:02

Hey. Is there a way to capture last item of transduce? I know that the mapping function has to be side-effect free but... I also transduce into a core.async channel... so I'm not sure what to do. Are there better ways to solve it?


not quite sure what you're asking but if you just want to use transduce and only care about the last result you could use a reducing function that just returns the last item:

(transduce (map str) (fn ([acc] acc) ([acc x] x)) nil (range 100))

Martynas M16:05:57

I want to use transduce and not only care about whole result but my result is already going to be put into a channel. But what I was thinking about is that I need to do some more computations on that result but I don't want to consume the channel. But that's probably some kind of a denial because I don't want to rewire everything. 😄


You can use core.async/mult to split the channel so you can consume the same result in multiple locations. Would that help?

Martynas M16:05:56

Thanks. I think that I have a snippet and I try to do too much with it. mult would work but I didn't want to touch the channel. But probably it's better to load everything into memory in advance and not care about much. i.e. if I would load everything into memory it's probably better to avoid frameworkisms... i.e. if I can do it without core.async then I should do it without and then simply calculate using basic seqs

Martynas M17:05:28

I simplified my code even more. Instead of using a transducer that would parse up until specific value I'll now use an infinite lazy sequence and then split-with. I don't yet know whether I'll put it into a channel but that channel could also be replaced by a loop.


on the subject of the maven ecosystem being wacky and wonderful - if one were to make a script for publishing an artifact, could that be done in a "sane" way without involving any of the aether stuff? (like ideally just http calls + gpg or whatever on a directory containing the stuff to publish, maybe generating a publish'd xml?)

Alex Miller (Clojure team)16:05:59

Clojars or Maven Central? It’s … complicated


Maven central let's say

Alex Miller (Clojure team)17:05:33

Most people use the nexus-staging-maven-plugin to push to Maven central, which requires several steps - you push all your artifacts to a staging repository, then release the staging repo (which fails, not infrequently, so you might need to retry), and then you close and drop the staging repo. Replicating that is not impossible (I mean, you're just sending bits over http at the end of the day) but its no picnic.

Alex Miller (Clojure team)17:05:12

Having been in groups trying to do this, we've ultimately chosen to shell out to Maven rather than replicate that

Alex Miller (Clojure team)17:05:15

There is of course some authentication stuff to deal with too


nexus-staging-maven-plugin isn't even up to date with the latest Java and requires add-opens to function


Preaching to the choir, I know


But feeling adventurous today. Going to give it a shot


Good god what is a Mojo

Martynas M17:05:57

Hey. How do I know which functions are included into There is a recent new function -- iteration and it's not included. Is there a way to include it there? I'd like to have examples and so on. It exists in here: But not in here: I like format better because it's highlighted and nicer to read (also you could take this as a feedback for

Martin Půda17:05:35

Clojuredocs covers Clojure 1.10.1. There is already to update it.