This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-09
Channels
- # beginners (47)
- # boot (5)
- # cider (25)
- # cljs-dev (2)
- # clojars (2)
- # clojure (33)
- # clojure-dev (25)
- # clojure-italy (2)
- # clojure-uk (35)
- # clojurescript (27)
- # core-async (2)
- # datomic (5)
- # graphql (2)
- # immutant (3)
- # off-topic (3)
- # onyx (2)
- # pedestal (4)
- # portkey (52)
- # reagent (2)
- # shadow-cljs (55)
- # spacemacs (21)
- # sql (8)
- # tools-deps (22)
Have there been any developments on the problem of dealing with interactions of libraries and their transitive dependencies? This is always a pain point when upgrading a project with many dependencies to new versions. Maybe the solution is microservices and minimizing the use of libraries altogether in those services, but perhaps there are better ideas out there I'm not aware of.
in spec, is there a way to create a binding?
if i were to write a spec for map
map could take any collection, but i want to create a binding for the type in the collection
and then say that the function mapped over the collection must take an argument that matches the spec in the binding
@ackerleytng I'm not quite clear what you're asking about -- can you give a code example?
@genekim Perhaps this article is also relevant. https://stuartsierra.com/2015/05/27/clojure-uncaught-exceptions.
@ackerleytng I'm not quite clear what you're asking about -- can you give a code example?
suppose we want to write a spec for clojure's builtin map function
map should take a collection with elements that all match a spec, say :foo
such that the spec for map would be something like (s/fdef map :args (s/cat :f (s/fspec :args :foo) :coll (s/coll-of :foo)))
something like that?
is there a way to bind foo temporarily
Well, the issue there is that map
is generic and there really isn't a direct 1:1 mapping between the collection "types" and the function input argument "type" -- you could write a spec for a specific wrapper around map
that was designed to work with a specific type.
clojure.core/map
is pretty much impossible to write an accurate spec for I think.
You could define your own int-map
function that only accepted (s/coll-of int)
and therefore required a function whose argument was restricted to int
(well, actually any type that int
can be coerced to -- and that's part of the problem). Do you see what I mean @ackerleytng?
Ah ok then the spec would be a bit too tight
(map (fn [^double d] (* 2.0 d)) [1 2 3 4])
for example
Anyway on the function that I'm speccing, I tried what you suggested with int, and clojure said it couldn't find something that satisfies in 100 tries
Don't have the exact message now...
Sounds like you need to provide a custom generator then.
(there's a #clojure-spec channel if you want to dig deep into spec)
ok thanks!
>Searchable message archives are at https://clojurians-log.clojureverse.org/ @ul It seems bot hasn’t been working since 2018-04-17
Looking for help on what do I need to do or precondition, in order to connect a repl to a running clojure 1.8/1.9 program. Sorry but I do not find https://clojure.org/guides/repl/enhancing_your_repl_workflow#writing-repl-friendly-programs of extreme help... your guidance or reference to a good source, would be much appreciated!
Can an expression that's passed to -e
be saved somewhere in the deps.edn file for later activation ?
No, sorry
@lockdown- is this something to do with the clj
tool?
I just put a question into the beginner channel regarding a websocket implementation, if anyone has time to look at it.
@noisesmith @hiredman @seancorfield @lloydshark Thanks for all the help, all! Y’all are fantastic!
So, there was a network exception of “could not connect”. But this didn’t explain the future
block not running. I ended rewriting the TCP call with just Java interop, getting rid of clj-tcp
library. All is working now, and much faster now, too. Good enough for me! Thx again!