This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-20
Channels
- # adventofcode (8)
- # aleph (2)
- # announcements (10)
- # aws (5)
- # aws-lambda (2)
- # babashka (23)
- # beginners (23)
- # biff (9)
- # calva (4)
- # cider (8)
- # clj-kondo (21)
- # clojure (77)
- # clojure-boston (1)
- # clojure-dev (50)
- # clojure-europe (36)
- # clojure-gamedev (3)
- # clojure-nl (1)
- # clojure-norway (3)
- # clojure-spec (33)
- # clojure-uk (3)
- # clojurescript (22)
- # core-async (3)
- # cursive (10)
- # datahike (18)
- # datalevin (1)
- # datascript (9)
- # deps-new (21)
- # emacs (11)
- # events (1)
- # graphql (11)
- # guix (26)
- # java (7)
- # jobs (3)
- # lsp (12)
- # malli (6)
- # pathom (33)
- # pedestal (3)
- # polylith (15)
- # reagent (5)
- # releases (3)
- # remote-jobs (1)
- # scittle (9)
- # sql (27)
- # tools-build (9)
- # vim (7)
Since borkdude so nicely made a release of babashka that works with my ‘solenoid’ library, I’ve made an https://github.com/adam-james-v/solenoid/blob/main/examples/example-script.clj Screenshot in 🧵 just for fun 🙂
Is there some edn "query tool" like jq for json? I can write something for my particular use case (finding the path to all entries in a edn structure which match a certain condition), but I have the feeling somebody did the work already.
There is #CM5HRADAA which also comes with specter, perhaps specter has something for this. It also supports regular clojure of course
Specter looks promising but I could not find a way to return the "current path"
well perhaps jet should have a built-in function for this (if jq has this) - feel free to post an issue
I'm actually not sure if jq has this 😛
I thought it makes sense when you can query on a data structure that you could get the location of the result as well
It seem it has... https://stedolan.github.io/jq/manual/#getpath(PATHS):~:text=paths%2C%20paths(node_filter)%2C%20leaf_paths
I made an issue here: https://github.com/borkdude/jet/issues/124
E.g. for {:foo {:bar {:t 1 :u 1} } :qux {:quux {:t 1 u:2}}}
I want to query for all paths which have the :t
key in the final position.
Here is a way to add dependencies to babashka using tools-deps-native. https://github.com/babashka/babashka/wiki/Adding-dependencies-without-Java-using-tools-deps-native This should be considered EXPERIMENTAL and doesn't really buy you anything other than not having to install Java which for some people / contexts may be useful.
https://github.com/borkdude/carve is now compatible with #babashka :
bb -Sdeps '{:deps {io.github.borkdude/carve {:git/sha "c8b12536527b5bd3da6ad4f3084122dbc36dfbc8"}}}' -x carve.api/carve! --paths src
cc @escherizeMaybe I did something wrong but when I run this, I get the following message:
bb -Sdeps '{:deps {io.github.borkdude/carve {:git/sha "c8b12536527b5bd3da6ad4f3084122dbc36dfbc8"}}}' -x carve.api/carve! --paths src
Cloning:
Checking out: at c8b12536527b5bd3da6ad4f3084122dbc36dfbc8
Downloading: clj-kondo/clj-kondo/2023.01.20/clj-kondo-2023.01.20.pom from clojars
Downloading: clj-kondo/clj-kondo/2023.01.20/clj-kondo-2023.01.20.jar from clojars
[babashka] WARNING: Use the babashka-compatible version of clojure.spec.alpha, available here:
----- Error --------------------------------------------------------------------
Type: java.lang.Exception
Message: Could not find namespace: clojure.spec.alpha.
Location: /Users/bcm/.gitlibs/libs/io.github.borkdude/carve/c8b12536527b5bd3da6ad4f3084122dbc36dfbc8/src/carve/impl.clj:4:3
----- Context ------------------------------------------------------------------
1: (ns carve.impl
2: {:no-doc true}
3: (:refer-clojure :exclude [run!])
4: (:require
^--- Could not find namespace: clojure.spec.alpha.
5: [clojure.edn :as edn]
6: [ :as io]
7: [clojure.set :as set]
8: [clojure.spec.alpha :as s]
9: [clojure.string :as str]
----- Stack trace --------------------------------------------------------------
carve.impl - /Users/bcm/.gitlibs/libs/io.github.borkdude/carve/c8b12536527b5bd3da6ad4f3084122dbc36dfbc8/src/carve/impl.clj:4:3
carve.api - /Users/bcm/.gitlibs/libs/io.github.borkdude/carve/c8b12536527b5bd3da6ad4f3084122dbc36dfbc8/src/carve/api.clj:3:3
exec-9159b317-d4ee-41ce-9fa2-d831c5cdcbdb - <expr>:4:1