Fork me on GitHub

Happy monday Clojurians! Announcing Parse edn/json/transit/yaml directly from Emacs using a magit-like interface emacs Besides the main entrypoint, the package has lots of commands to parse edn and: • copy to clipboard • to a new buffer • print to messages • just paste at cursor Available at MELPA!

🙌 32
jet 4
cljparrot 13
❤️ 1
yes 1

PR welcome to jet to mention this tool :)


Thanks, I'm working on that exactly now :p

Christian Johansen12:02:41

Amazing stuff 👏

Christian Johansen12:02:09

Can I somehow make keybindings for common pairs of options?

Christian Johansen12:02:31

Eg, make an interactive command that sets input to JSON, output to EDN, and copies to the clipboard

Christian Johansen12:02:11

This is possibly feedback to jet more than this glue, but it would be cool if jet was able to guess the input automatically - seems like it should be possible?


it's possible indeed, I'll add a example in the readme


guess the input is a little bit harder I guess


I guess all json is valid transit, so how would you guess the difference?

Christian Johansen12:02:19

try parsing it as transit first?

Christian Johansen12:02:30

Sorry, I misunderstood

Christian Johansen12:02:43

If transit can read both transit-specific JSON and just regular JSON, then there is no big problem? Default behavior with no -i could be to try to parse as edn, then as transit, then as yml.


I guess you could do this in emacs first and then see how it works out


nice I use jet extensively for formatting in emacs and converting between json and edn, I will go install, @U04V15CAJ curious if it would be possible to add in other map types like say python dict's as a quick way to convert, between languages I guess custom parsers would be needed ?


@UU67HFS2X What does that look like?


pretty similar to javascript maps: {'foo': 'bar'} IIRC


in that case converting from JSON should already work?


except that JSON doesn't support single quotes I guess

👍 1
Christian Johansen12:02:08

(defun jet-to-clipboard (thing &optional args)
  "Run jet for THING at cursor and ARGS copying to clipboard."
It’s been a while since I wrote elisp… What’s thing @UKFSJSM38?


Got me wondering now, sure I would have tried the json version, need to go find a python map now and try that


I think where the python map fails is on the values, so you can have functions for example, the json parser does not like those, there maybe other data values but I imagine most are compatible


Usually (jet--thing-at-point) @U9MKYDN4Q, the region selected or current form at point

Christian Johansen13:02:02

Yeah, just found it 😅 Thanks 🙏


@U9MKYDN4Q I improved the readme mentioning how to customize the functions so you can keybind

Christian Johansen13:02:04

I ended up with these:

(require 'jet)

(defun copy-edn-as-json ()
   '("--from=edn" "--to=json"))

(defun copy-json-as-edn ()
   '("--from=json" "--to=edn" "--keywordize"))

(global-set-key (kbd "C-c j e j") 'copy-edn-as-json)
(global-set-key (kbd "C-c j j e") 'copy-json-as-edn)

👍 2
Christian Johansen13:02:39

New Readme will save the next person some time 😄

Christian Johansen13:02:50

Anyway, amazing stuff, thanks for your effort 👏


Added your example to the readme how to keybind, thank you! gratitude

🎉 3

this is honestly so damn useful @UKFSJSM38 thank you (and thanks again to borkers!)

gratitude 1

New: Simple clustering: • Pure Clojure/Clojurescript implementation Hope it is helpful! :rightwards_hand: 🎁 And more to come :face_with_open_eyes_and_hand_over_mouth:

👍 8
👀 3

nice! what lead you to write it? 🙂

🙏 1

Thanks! I'm releasing a library in the next couple of days for building Re-frame/React apps that includes a visual debugger that overlays graphical elements onto the live application. I needed a simple clustering algorithm for collecting and grouping certain visual elements on the screen.

🚀 2
Carsten Behring17:02:51

Would you consider to "bind" your library closer to the upcoming Clojure data science stack by using a "" (a column oriented table) as input data, instead of vector-of-maps TMD is living here: If this is the case, you could as well considre to integrate the DBSCAN algorithm in one of the existing" collections of algorithms working on the same data format.


Sure, I actually use quite regularly, it's fantastic. But never thought to connect the two! I'd have to think about what that would entail, are there examples in the code-base of other grouping or clustering bindings I could look at as a pattern to follow?

Carsten Behring18:02:55

It should be very easy . The "core" of your algorithm could even stay as is. You would just convert from dataset to vector-of-maps, run your stuff and convert back to a This might come with small performance penalty (versus rebuilding the algorithm using the TMD primitives), but probably negligible. So you just need a functions like yours : but it takes a "" as input. (and reurn such dataset as well), so things can be chained easely. Probably you need some options to define on "which columns" your clustering is performed.

Carsten Behring18:02:27

This new code would be a kind of "adapter" to TMD. So where "physically" place your original code and teh adapter is a question to answer. Doing the adapter will require a dependency to , so maybe you code in wants to avoid that.

Carsten Behring18:02:40

I would maybe even suggest to have the "adapter" standalone, depending on

io.zalky/dbscan-clj {:mvn/version "0.1.0"}
techascent/ {:mvn/version "7.000-beta-27"}
and it just does the data conversion and calls dbscan and converts back. A few lines of code in my view.

👍 1
Carsten Behring18:02:56

(one reason being ClojureScript compatibility). TMD is a Clojure library, not compatible with ClojureScript


Yes, I agree with these points. I'll take a bit of a closer look to see what alternatives there are for integrating with's abstractions. There might be some protocols or interfaces that are easy to implement. Thanks for planting the seed, I don't think I would have made the connection otherwise.


com.walmartlabs/lacinia 1.2 Lacinia is an open-source implementation of the GraphQL specification, in Clojure. GraphQL is an outstanding approach to getting diverse clients and servers exchanging data cleanly and efficiently. GitHub repo: Documentation: Lacinia 1.2 fills in some gaps in Lacinia's functionality. Notable changes: • Direct control over the Executor used for callbacks • Subscription streamer functions are now on-par with ordinary field resolver functions by supporting directives and supporting access to the preview API • The entire has been rewritten to be more clear, and use modern standards (such as tools.deps for the build, and using Pascal Case field names).

🎉 12
Sam Ritchie22:02:19

Announcing v0.3.0 of clerk-utils , a library designed to help write interactive docs like with #clerk. This release adds{build!,serve!,halt!} functions for building custom ClojureScript bundles for #clerk. This lets you use ~any JS or CLJS library when writing custom viewers in Clerk. See the interactive docs notebook section on Custom ClojureScript for more detail: 0.3.0 also adds a clerk-utils/custom #deps-new template ( for generating a Clerk project with all of the custom ClojureScript stuff baked in. (Here’s • Release notes: • Clojars: • Github:

🚀 14
🔥 5
quoll22:02:52 v0.0.1 A simple Turtle writer. This library converts basic Clojure structures into formatted turtle files. It accepts nested maps, such as used by Asami, or identifiers paired with simple maps. For simplicity, keywords are treated as QNames/CURIEs, and will be written out this way.

🐢 20
Cora (she/her)00:02:41

what's a Turtle in this context?

Cora (she/her)01:02:11

I really don't know much about RDF

Cora (she/her)01:02:24

maybe I should read about it


It’s been my career for over 20 years, so… 😄

Cora (she/her)01:02:02

so ask you instead?? 😜


I’m more than happy to help. But if you want something to read, you can start

💜 2

cool name 🙂


Well, the partner library (for parsing Turtle files) is called


makes sense 🙂