Fork me on GitHub
#beginners
<
2018-06-30
>
eric.d.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 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?

alexmiller01:06:54

None of that is automatic

alexmiller01:06:19

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

seancorfield01:06:14

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.

seancorfield01:06:58

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.

seancorfield01:06:24

But source code on GitHub can be used without artifacts, with the clj / tools.deps tooling that Clojure 1.9 introduced.

seancorfield01:06:23

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.

oliv08:06:02

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

oliv08:06:29

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

oliv08:06:35

what I’m missing here

pez08:06:02

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

oliv08:06:30

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

oliv08:06:53

yeah Pez I had an idea was something like streaming

oliv08:06:56

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

alexmiller11:06:10

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

alexmiller11:06:30

What you’re seeing is the effect of chunking

alexmiller11:06:27

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

alexmiller11:06:45

map and filter both use chunking

oliv18:06:30

> What you’re seeing is the effect of chunking amazing @alexmiller

andy.fingerhut18:06:07

@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.

oliv18:06:37

yeah @andy.fingerhut thanks