Fork me on GitHub
#clojure
<
2022-09-25
>
Dan09:09:25

Is there a good way to search clojure docs for macros with a specific set of bindings?

Dan09:09:06

I'm asking purely so I can get linting working for some much used custom macros.

p-himik09:09:16

What do you mean by "specific set of bindings"?

Dan09:09:16

I should say parameters! Been working way too much with let lately!

Dan09:09:04

(defn fn-name [arg1 arg2 &amp; more-args] ...)

borkdude09:09:06

Let me know if you need help with macros and linting

craftybones12:09:15

can probably just do a bunch of ns-publics on interested namespaces and filter based on meta there? Like so

(->> 'clojure.core
     ns-publics
     vals
     (map meta)
     (filter :macro) 
     (map (juxt :name :arglists)))

craftybones12:09:20

Unless that's not what you are looking for?

pppaul23:09:13

can someone recommend a library for making zip files/streams. i just tried using hara and i'm running into problems (java side errors, so i can't debug this)

pesterhazy07:09:32

Have you tried plain java.util.zip?

pesterhazy07:09:23

My (counterintuitive, perhaps? rule of thumb: always try the obvious java solution via interop first

borkdude08:09:48

babashka fs support creating zip files but you can look into the implementation for inspiration: https://github.com/babashka/fs/blob/master/API.md#zip Also tools.build has API functions for zipping. https://clojure.github.io/tools.build/clojure.tools.build.api.html#var-zip

kwladyka10:09:23

I use me.raynes.fs.compression to unzip files

kwladyka10:09:49

in my case (compression/unzip zip-path target-dir)

borkdude10:09:28

babashka fs also supports unzip

kwladyka10:09:28

I use this dependency anyway, so it was the simplest choice

kwladyka10:09:27

I didn’t try babashka.fs. Maybe I should pay more attention to babashka.

kwladyka10:09:40

it seems to be very popular

borkdude10:09:02

babashka is a scripting environment (fast startup) but it contains libraries that you can also use with the jvm: babashka.process (shelling out), babashka.fs (file system utils), babashka.cli (command line parsing)

👍 1
kwladyka10:09:21

> scripting environment (fast startup) What exactly this mean? I always thought babashka is the Clojure alternative for bash.

borkdude10:09:30

@U0WL6FA77 A lot of programs you write with (pure) JVM Clojure also work in bb, only with faster startup which makes it more like bash scripting. But it has nothing to do with bash, it just makes it possible to replace bash scripts with a better language: Clojure :)

kwladyka10:09:03

damn, I have no idea what it is. I have to try to understand 🙂

borkdude10:09:53

@U0WL6FA77 I think bb is best understood by just trying to use it for some scripting. Website: https://babashka.org/ Docs are here: https://book.babashka.org/

borkdude10:09:28

Disclosure: I'm the author of bb, in case you didn't notice ;)

borkdude10:09:50

If you have more questions, welcome in #babashka - I think I hijacked the conversation enough for now ;)

pppaul16:09:09

thanks. i'll look into bb and i'm already using raynes so i'll look at that as well. i'm not looking to unzip stuff, i'm just trying to create/serve up zip files to clients from a webapp

👍 1
pppaul16:09:42

@U0WL6FA77 raynes has exactly what i need, and very easy to understand code. me.raynes.fs.compression/make-zip-stream seems perfect.

👍 2
Tuomas-Matti Soikkeli06:09:39

Please note that me.raynes.fs is not maintened anymore, I have understood that the author has passed away. The library is forked and maintaned in https://github.com/clj-commons/fs

👍 2