This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-30
Channels
- # beginners (23)
- # boot (3)
- # cider (5)
- # clara (12)
- # cljs-dev (15)
- # clojure (18)
- # clojure-spec (24)
- # clojure-uk (23)
- # clojurescript (24)
- # data-science (2)
- # datascript (1)
- # datomic (12)
- # fulcro (51)
- # jobs (1)
- # jobs-discuss (1)
- # leiningen (1)
- # nrepl (1)
- # off-topic (1)
- # onyx (2)
- # re-frame (6)
- # reagent (14)
- # rum (1)
- # shadow-cljs (12)
- # spacemacs (3)
- # specter (1)
- # tools-deps (37)
- # vim (2)
Hi, I'm trying to deploy my first clojar. Am I incorrect in the assumption that 'lein deploy clojar' would automatically set up a github account under the designated group name? It succeeded in setting up the http://clojars.org artifact, but I was expecting the code automatically to be written to the corresponding github account. The link is there but it draws a 404 error. Do I need to set this account up separately, or is there some incantation I'm missing?
None of that is automatic
If you want a GitHub account, you’ll need to set it up
OK. Thanks.
lein deploy
just takes the .jar
file and pushes it up to http://clojars.org. GitHub for your source code is a whole separate thing.
You can have artifacts on http://clojars.org that are not open source, and you can have source on GitHub that doesn't have artifacts built & published anywhere.
But source code on GitHub can be used without artifacts, with the clj
/ tools.deps
tooling that Clojure 1.9 introduced.
And there's lein-tools-deps
to allow you to leverage deps.edn
and therefore local source and source on GitHub -- without artifacts playing a part.
just one quick question guys I have the follow code
(defn inc-p [n]
(println "inc-p" n)
(inc n))
(defn filter-p [n]
(println "filter-p" n)
(odd? n))
(->> (range 1 3)
(map inc-p)
(filter filter-p))
I run the code and my idea was ( because of lazy seq ) the output would be something like
inc-p 1
filter-p 2
inc-p 2
filter-p 3
but was completely different
inc-p 1
inc-p 2
filter-p 2
filter-p 3
I thought was something like this:
filter ask next value to the lazy-seq which is the map lazy-seq
but seems the map runs all items from the range and after exhaust the range will pass to the filter runthe complexity is: O(map + filter = 2n) which is O(n) .. I thought it was only O(1n) … I mean the loop would run only just one time
feeling bad about my misconception regarding lazy-seq … I thought the behavior were completely different . 🙂
my ideia was something like this. but seems I’m missing anything here
(->> (list "Shake" "Bake") ;
(map #(str % " it off")) ; 1
(map clojure.string/lower-case) ; 2
(into []))
into is implemented with reduce, which walk the lazy seq asking for the next value, which asks the top lazy seq which asks the next lazy seq which asks the list
No that’s all correct and it is O(n)
What you’re seeing is the effect of chunking
For performance, chunked lazy seqs amortize the cost of realization by doing 32 elements at a time
map and filter both use chunking
> What you’re seeing is the effect of chunking amazing @alexmiller
@oliv If you try your example with (range 1 3)
replaced with something longer than 32 elements, e.g. (range 50)
you should see how chunking effects the order more fully.
yeah @andy.fingerhut thanks