Fork me on GitHub
#beginners
<
2017-03-26
>
deg13:03:50

I'm trying to organize a (conceptual) package as multiple Leiningen-based projects. I already have the two main ones: my server and client, based on Pedestal/Vase and the re-frame template with Figwheel; both using Cider/Emacs. I now need to create a small project of shared code -- initially just a few functions in a .cljc file, but I assume it will grow with time. What tooling should I use for this? Is there any sample template to get me started? What best practices do I need to follow so that changes to the shared code project will be exposed, as painlessly as possible, to my dev client and server?

yonatanel15:03:10

@deg I'm not very familiar with releasing cljs and .cljc files, but perhaps leiningens "/checkouts" directory can help you there. If you symlink the common code project in /checkouts folder under the dependent project it will use it as dependency instead of clojars for example.

deg15:03:21

Thanks. That definitely seems like it will be one piece of the puzzle.

noisesmith15:03:59

just be aware that to use checkouts, you first need to run lein install in the project accessed via checkouts

noisesmith15:03:40

but after that, the project that has it checked out will see updates without you needing to repeat the lein install (at least, until you change the version number of the project)

noisesmith15:03:10

in fact, since lein install is needed anyway, I skip checkouts, use lein install, and run load-file to access new definitions from the library as I edit it

lepistane19:03:51

i've got question i know it's subjective

lepistane19:03:40

i've watched a lot of clojure talks on youtube and some of them say that SICP book is extremely beneficial

lepistane19:03:57

this is my second time starting to read it

lepistane19:03:01

and it feels like i am forcing it. it puts so much strain on me

lepistane19:03:52

it's hard but when something is hard in a fun way - you think about it all the time trying to find solution it's fun it motivates you but this seems to be hard on like - oh thank got i dont have to think about it anymore

lepistane19:03:25

should i tryhard and force myself to read and study SICP? is it really worth it as people say it is?

mobileink21:03:59

lepistane: depends; what is your goal, and how much programming have you done? if you just need to get started with functional (lispy) programming, a much better 1st book is https://www.google.com/search?q=little+schemer&amp;oq=little+schemer&amp;aqs=chrome..69i57j0l3.7898j0j4&amp;client=ms-android-verizon&amp;sourceid=chrome-mobile&amp;ie=UTF-8 warning: it's almost unbearably cute, but it covers all the most important stuff very concisely. go to sicp after you read it.

tbaldridge21:03:49

One of the problems with a lot of these Scheme based books is that they focus on the wrong things, imo. Recursion vs iteration is good to know. And how to walk a tree is something that should be learned, but all that pales in comparison to immutable data.

tbaldridge21:03:39

So I'd focus more on immutability, and concurrency in Clojure, then move on to SCIP and little schemer if you want to branch out a bit

mobileink21:03:31

i think it depends on where you're starting from. i read (parts of) sicp before i came across the little schemer, but it was the latter that really made me understand not just recursion but common patterns in lispiness. immutability it a whole 'nother matter, imho. it's a lot more complicated than clojure folks make it sound.

mobileink21:03:58

actually i think immutability is on of the more arcane features of clojure. it's really a misnomer; it doesn't mean "no changes", it means "controlled changes".

seancorfield20:03:22

@lepistane The book is hard going. I think the videos of the lecture series are much more approachable so perhaps try those for a first time through and then go back and read the book? http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/ (this page explains that the videos follow the 1985 edition of the book etc)

danp20:03:56

@seancorfield Thanks for that link - coincidentally, I found out about SICP last night. I'll be sure to check out the lectures if they're a good intro 🙂

redeu21:03:26

I find these videos surprisingly comfy in an unusual way