off-topic

https://github.com/clojurians/community-development/blob/master/Code-of-Conduct.md Clojurians Slack Community Code of Conduct. Searchable message archives are at https://clojurians-log.clojureverse.org/
2021-01-30T00:24:13.252800Z

@borkdude Not sure if this helps any but in the node-based glob libs it would be * for any file in current directory and ** for recursion.

2021-01-30T00:24:54.252900Z

*.clj would look for any files as children in current directory where as **/*.clj would look for any clojure files in any subdirectory.

borkdude 2021-01-30T07:51:30.253500Z

Thanks!

borkdude 2021-01-30T13:20:14.257Z

Another fs lib related question. I'm building a lib around java.nio but more clojure friendly. A lot of nio functions return java.nio.file.Path objects, but in Clojure I think we are more used to <http://java.io|java.io>.File. For e.g. glob function, what would be the most convenient in Clojure world, a vector of Path or File?

Ben Sless 2021-01-31T08:00:13.277400Z

Returning a wrapped type is always an issue as writing a complete wrapper is a pain and it's less approachable to users, no? Why do you consider protocols a coercion?

borkdude 2021-01-31T08:02:12.279500Z

Oh I mean returning a thing which implements that protocol but yeah, you can extend the protocol to the known type. But since there are only two, and doesn’t have to be extended I don’t see much benefit

borkdude 2021-01-31T08:02:37.279900Z

Over just a function

Ben Sless 2021-01-31T08:03:30.280100Z

"Just a function" is always a sane choice

2021-02-01T16:35:50.415300Z

both Path -> File and FIle -> Path are present in Paths (and as far as I know are cheap). But I think what clojure code would want is usually a File

borkdude 2021-02-01T16:36:38.416200Z

I pushed an initial release of this lib to clojars: https://babashka.org/fs Test / review highly appreciated

borkdude 2021-02-01T16:36:56.416400Z

There is an fs/file and fs/path to convert between the types

alexmiller 2021-01-30T13:29:49.257800Z

It is a hard thing and I do not think there is an easy answer

alexmiller 2021-01-30T13:30:39.258700Z

I have chosen to mostly focus on File entry points for functions in stuff I’ve done

alexmiller 2021-01-30T13:31:55.260100Z

We have talked about extending http://java.io with more Path support but I do not have a clear idea about how to do that cleanly

borkdude 2021-01-30T13:54:34.261Z

What I currently do: the resulting value can be fed into both a file and path function, which converts it to a Path or File and all API functions accept both

borkdude 2021-01-30T13:55:42.261400Z

and maybe that is the only contract I should offer, the concrete return types shouldn't be important. if you need files, use (map fs/file ...).

clyfe 2021-01-30T20:38:03.271400Z

I'm pretty surprised by how much I like https://github.com/hlissner/doom-emacs after toying with it, so polished and nifty. More so compared to this other more popular project that felt all janky and slow and buggy.

1👍2