This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # aws (4)
- # beginners (21)
- # boot (12)
- # cider (3)
- # cljs-dev (1)
- # cljsrn (10)
- # clojure (190)
- # clojure-nl (1)
- # clojure-russia (7)
- # clojure-spec (1)
- # clojure-sweden (9)
- # clojure-uk (30)
- # clojurebridge (1)
- # clojurescript (105)
- # cursive (4)
- # emacs (8)
- # jobs (1)
- # jobs-rus (4)
- # klipse (1)
- # luminus (5)
- # om (3)
- # onyx (2)
- # pedestal (5)
- # powderkeg (15)
- # re-frame (13)
- # reagent (1)
- # ring-swagger (5)
- # rum (5)
- # vim (8)
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?
@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.
just be aware that to use checkouts, you first need to run
lein install in the project accessed via checkouts
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)
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
i've watched a lot of clojure talks on youtube and some of them say that SICP book is extremely beneficial
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
should i tryhard and force myself to read and study SICP? is it really worth it as people say it is?
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&oq=little+schemer&aqs=chrome..69i57j0l3.7898j0j4&client=ms-android-verizon&sourceid=chrome-mobile&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.
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.
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
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.
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".
@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)
@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 🙂