Fork me on GitHub
#clojure
<
2018-12-20
>
danielstockton10:12:29

I believe there is a quote in 'maybe not' from the conj, where Rich Hickey talks about design as separating two ideas that shouldn't be conflated... Anyone remember the exact quote, or can formulate it nicely?

danielstockton10:12:51

Yep, that one 🙂 I was in a discussion trying to make a point, and didn't have time to re-watch the whole video. Think I got my point across anyway.

andy.fingerhut15:12:58

There are transcripts for most of Rich Hickey's talks available here: https://github.com/matthiasn/talk-transcripts/tree/master/Hickey_Rich

andy.fingerhut15:12:01

It is definitely a point he has talked about in more than one of his talks.

benoit17:12:47

I'm not convinced that the example in the talk is an instance of decoupling. The problem with s/keys seems to be that you cannot create nested requirements so you end up having to create intermediate specs for every single combination you need in order to properly spec your functions's input. If you introduce a new abstraction like select to describe your nested requirements then you solve your problem. I don't see why the idea of schema is even required. And I even wonder if it could hurt composability. What if my function requires a map that is composed of two different sets of keys? Let's say my users can have different roles. editor and author for example. I have schemas for these two roles that define editor-specific and author-specific set of keys. If a function requires a user entity that has both roles, what schema do I use? Do I have to create a new schema to represent the union of the roles?

Alex Miller (Clojure team)17:12:54

union the existing ones with s/merge

isak17:12:03

Isn't selection (vs schema (shape)) only one of many possible things that could be dependent on context?

ccann17:12:30

Just upgraded from clojure 1.8 to 1.10 and discovered that two of my defns had optional keyword args with :or as a vector instead of a map. Thanks spec! (though tbh at first I was like what is the mountain of text and I don’t see how this thing fails the simple-symbol? predicate) :pred clojure.core/simple-symbol?, :val {:keys [graphic? lock?], :or [graphic? false lock? false]} but further down, eventually: :pred clojure.core/map?, :val [graphic? false lock? false],

benoit18:12:30

@alexmiller ok makes sense. But what is the schema for? Can't the select just list the nested keys it needs?

Alex Miller (Clojure team)18:12:08

I don’t know any more than you do about the design at this point

Alex Miller (Clojure team)18:12:39

so I can’t answer any questions that aren’t answered by Rich’s talk

benoit18:12:58

Got it. thanks.

lwhorton19:12:43

is there somewhere i can go to read up on readers, readables, iostreams, etc?

lwhorton19:12:00

having a hard time trying to conceptualize writing to anything that’s not just a regular file

Alex Miller (Clojure team)20:12:16

Streams are Java’s byte stream abstraction

Alex Miller (Clojure team)20:12:29

Readers are character based

Alex Miller (Clojure team)20:12:50

So readers can be built from streams

Alex Miller (Clojure team)20:12:09

(Given a particular character encoding)

lwhorton20:12:14

ah, ok. so if i wanted to write to a file i have the option of working in streams or characters. but what if i wanted to say, hand an http-lib an output stream? i’m not sure the combination of binding [*out ...] or pr vs pr-str to convert a structure into a stream … figured there would be a big blog post somewhere about all of it

Alex Miller (Clojure team)20:12:03

If doing output, you typically want an OutputStream to write values to

Alex Miller (Clojure team)20:12:20

Or a Writer that wraps an OutputStream to write characters

lwhorton20:12:17

:thumbsup: just enough of what i’m looking for so i don’t keep going in circle with google, thanks

dpsutton20:12:37

i've always wanted a java for clojure programmers series,book,talk, etc

👍 4
lwhorton20:12:09

some thin 100 pages would be fantastic, for all the things that eventually end up confusing you because … java

👍 4
kwladyka22:12:22

What is the best way to use module written deps.edn and clj in lein? I guess deploy this module to clojars, but how to deploy to clojars without lein? In other words I did module using deps.edn, but I want to let developers who use lein use it also.

kwladyka22:12:32

it is cljs module if it matter

kwladyka22:12:55

BTW it is really hard to find articles in google, because clj / clojure / deps.edn are too general words to find solutions about new way of developing using clj command. It could be very useful if Clojure community start to use better (more unique) name for this solution.

kwladyka22:12:46

@alexmiller sorry to point you directly, but you are the one who can appreciate this feedback maybe AFAIK.

Alex Miller (Clojure team)22:12:16

Yeah, sorry I don’t have a solution for that

kwladyka22:12:09

Sure, I am saying this more to consider it in the future

kwladyka22:12:51

I mean core Clojure team make trends 😉

fmnoise22:12:48

@kwladyka tools.deps.alpha is good name for that

👍 4
kwladyka22:12:01

ok so one way is to use deps-deploy with clj to let developers who use lein add this dependency. Other alternatives?

kwladyka22:12:58

Hmm potentially make deps.edn which point to module using git commit hash like github-kwladyka/form-validator {:git/url "" :sha "3674d524d9d4019fcc494788e3fc878f6bd794e7"} and use this file with lein.

kwladyka22:12:34

So I found 2 solutions to make it use with lein. Will it be fine for you as developers to create deps.edn using lein to add dependency like this? What is the standard about it?

kwladyka22:12:22

I am going sleep now, but I will read your feedback tomorrow. Thank you!

seancorfield23:12:48

@kwladyka Did you see lein-tools-deps?

kwladyka07:12:48

not sure, but the question is if community will like to use lein-tools-deps only to use my module. It is not about me 🙂 I have feeling deps.edn is still not known for everybody in practice.

kwladyka07:12:19

But I can start with it and eventually and module to clojars if I get such feedback

kwladyka07:12:26

If anybody will like to use my module anyway 😉