Fork me on GitHub
Eric Scott00:06:28

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 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?

Alex Miller (Clojure team)01:06:54

None of that is automatic

Alex Miller (Clojure team)01:06:19

If you want a GitHub account, you’ll need to set it up


lein deploy just takes the .jar file and pushes it up to GitHub for your source code is a whole separate thing.


You can have artifacts on 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 run


the 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


what I’m missing here


I think you need to use something like core/async if you want stream-like behavior.


feeling bad about my misconception regarding lazy-seq … I thought the behavior were completely different . 🙂


yeah Pez I had an idea was something like streaming


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

Alex Miller (Clojure team)11:06:10

No that’s all correct and it is O(n)

Alex Miller (Clojure team)11:06:30

What you’re seeing is the effect of chunking

Alex Miller (Clojure team)11:06:27

For performance, chunked lazy seqs amortize the cost of realization by doing 32 elements at a time

Alex Miller (Clojure team)11:06:45

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.