This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-20
Channels
- # adventofcode (47)
- # announcements (3)
- # aws (29)
- # bangalore-clj (3)
- # beginners (63)
- # boot (2)
- # braveandtrue (40)
- # calva (34)
- # cider (37)
- # cljs-dev (8)
- # clojars (3)
- # clojure (45)
- # clojure-europe (2)
- # clojure-france (4)
- # clojure-india (2)
- # clojure-italy (44)
- # clojure-japan (4)
- # clojure-nl (39)
- # clojure-serbia (1)
- # clojure-spec (21)
- # clojure-uk (75)
- # clojurescript (28)
- # cursive (24)
- # data-science (3)
- # datomic (31)
- # emacs (13)
- # fulcro (35)
- # hoplon (21)
- # jobs-discuss (66)
- # nrepl (18)
- # off-topic (72)
- # pathom (35)
- # re-frame (20)
- # reagent (54)
- # shadow-cljs (35)
- # spacemacs (9)
- # specter (8)
- # sql (13)
- # testing (9)
- # tools-deps (21)
- # vim (3)
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?
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.
There are transcripts for most of Rich Hickey's talks available here: https://github.com/matthiasn/talk-transcripts/tree/master/Hickey_Rich
It is definitely a point he has talked about in more than one of his talks.
@danielstockton Rich talks about decomplecting the most in this one 🙂: https://www.infoq.com/presentations/design-composition-performance-keynote
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?
union the existing ones with s/merge
Isn't selection (vs schema (shape)) only one of many possible things that could be dependent on context?
Just upgraded from clojure 1.8 to 1.10 and discovered that two of my defn
s 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],
@alexmiller ok makes sense. But what is the schema for? Can't the select just list the nested keys it needs?
I don’t know any more than you do about the design at this point
so I can’t answer any questions that aren’t answered by Rich’s talk
having a hard time trying to conceptualize writing to anything that’s not just a regular file
Streams are Java’s byte stream abstraction
Readers are character based
So readers can be built from streams
(Given a particular character encoding)
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
Oh I’m sure there is
If doing output, you typically want an OutputStream to write values to
Or a Writer that wraps an OutputStream to write characters
:thumbsup: just enough of what i’m looking for so i don’t keep going in circle with google, thanks
you may like this one https://leanpub.com/clojure-java-interop
some thin 100 pages would be fantastic, for all the things that eventually end up confusing you because … java
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.
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.
@alexmiller sorry to point you directly, but you are the one who can appreciate this feedback maybe AFAIK.
Yeah, sorry I don’t have a solution for that
There are a list of tools at https://github.com/clojure/tools.deps.alpha/wiki/Tools
ok so one way is to use deps-deploy
with clj
to let developers who use lein
add this dependency. Other alternatives?
Hmm potentially make deps.edn
which point to module using git commit hash like github-kwladyka/form-validator {:git/url "
and use this file with lein
.
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?
@kwladyka Did you see lein-tools-deps
?