Fork me on GitHub
#beginners
<
2016-04-11
>
puhrez07:04:32

Any reason why running -main from the repl would behave differently than running from the jar given that the project’s :main is that -main’s namespace?

sveri07:04:13

@puhrez: Different compilation settings? Different settings in dev profile than in uberjar profile? Different application configuration used?

sveri07:04:18

There are a lot of possibilities, it is hard to guess whats going on without specific errors or whatever is going wrong for you

puhrez07:04:11

ya i know rather general, but from there we can drill down!

puhrez07:04:16

its like, my -main maps over a set of messages publishing each to a notification service (AWS SNS), but it doesn’t seem like it’s mapping at all during jar execution

puhrez07:04:30

i put a println in there and nada

puhrez07:04:07

ya i don’t have any different profiles in my project.clj or my profiles.clj that would affect compilation

sveri07:04:26

Hm, my project.clj and main clj file look like these:

puhrez07:04:55

hmm the only different i’ve found between this project adn others is that :aot :all

puhrez07:04:03

i will lookinto that omit-source tho

sveri07:04:39

Hm, I dont think the :omit-source is important here, just left it in there for completeness. Good luck simple_smile

sveri07:04:02

Do you build an uberjar or just a jar file?

puhrez08:04:30

hmm, also just noticed that i didn’t get a compilation error despite only of my dependencies not being the project.clj...

sveri08:04:17

did you run a lein cleanalready?

puhrez08:04:15

and i don’t have auto clean on

puhrez08:04:22

so it would’ve done that before uberjarring

sveri08:04:01

Hm, strange

puhrez08:04:03

hmm i found the issue

puhrez08:04:19

have a println form after my map seems to skip over the map...

puhrez08:04:06

is this a thing or am i just doing stupid stuff?

puhrez08:04:21

(let [my-set (get-set input)]
(println "doing blah to" (count my-set) "things")
(map blah my-set)  (println "Done"))

puhrez08:04:56

(sorry for the shitty formatting) but basically with that last println the map was being skipped over

sveri08:04:56

@puhrez: map is lazy and will not evaluate until you force it to in some or the other way

puhrez08:04:35

that’s why it works when i put a call to count before the final println

sveri08:04:25

Also REPL calls evaluate map IIRC

puhrez08:04:37

well im really glad it was something fundamental like that pshh

sveri08:04:30

I often fell into this trap too 😄

puhrez08:04:57

@sveri: thank u very much for ur help

sveri08:04:20

No problem, you'r welcome simple_smile

abhishekamralkar09:04:27

What is the best way to get started with Clojure?

jumar09:04:12

It depends: I’d say that Living Clojure (http://shop.oreilly.com/product/0636920034292.do) is a really good book for beginners.

jumar09:04:42

I also found quite interesting the interactive implementation of Game of Life in Clojure: https://github.com/kolman/GoL-Clojure - definitely not a tutorial but it’s really cool to see Clojure in action

abhishekamralkar10:04:25

Any practical tutorial ?

mull10:04:30

@abhishekamralkar: did you look at http://www.braveclojure.com/?

abhishekamralkar10:04:48

Yes I am reading it

puhrez10:04:22

@abhishekamralkar: https://github.com/functional-koans/clojure-koans this is useful for practice

mull10:04:30

Oh okay. I think there’s a book called “Clojure Applied” or something like that. It’s not aimed at complete beginners I guess

abhishekamralkar10:04:10

Also I was thinking to start with small project in Clojure so that I can use it scratch my head thinking like Clojurian. simple_smile

puhrez10:04:44

the wonderland katas are great for that

puhrez10:04:43

ya and super fun!

abhishekamralkar11:04:59

Cool. Thanks for sharing.

adamkowalski21:04:47

have any of you used meteor with clojurescript?