Fork me on GitHub
Shubham Kumar16:11:26

as a beginner to cljs is a good book? I haven't done frontend development professionally. I know the basics of HTML, CSS and JS. And I am learning cljs but just making sure if I am doing this right : learn cljs -> learn fulcro

Ferdinand Beyer16:11:47

I would say Fulcro is a lot if you are new to ClojureScript. What’s your learning goal? Do you already know Clojure?

Shubham Kumar17:11:35

I've worked with functional languages and I like the concept of immutable data types and functions as data. My past experience has mostly been in ocaml, rust, coq, purescript and a bit of react not much but I know the hang of it. Have also done a fair amount of python and bash scripting (I dislike bash and still did it for a year) I am trying to learn clojurescript specifically because I want to built something visual and animated (using quil ofc). I tried rescript but I think the JS-FFI is not something I understand, although I am still trying and there aren't much resources now, at least compared to cljs. Clojurescript has a mature ecosystem and there is a lot of attention to design of programs. I have also used and liked racket but I haven't coded much in it because of an irrational fear of looking like I am using a lot of "theoretical" languages and not real world languages. Also JS was supposed to be a lisp so I want to try and learn lisp for frontend development. Lastly for my overshare (πŸ˜…) I would say I have not built something that I am proud of because I never enjoyed it. I am unemployed right now so I thought what the hell!! Anyway so that's my learning goal.

Shubham Kumar17:11:00

And I am learning clojurescript using the book :

Shubham Kumar17:11:37

Also getting a job is easier for frontend devs. I just need to showcase what I can do (which I don't know yet)

Shubham Kumar17:11:45

I was interested in formal verification (although I have no official education in it) but the market for that is very slim if you don't have a phd. So I thought "let's be employable"

Shubham Kumar17:11:44

> Also getting a job is easier for frontend devs. I just need to showcase what I can do (which I don't know yet) not implying that the job is easy just that there is a market for frontend development and not proof engineering (in India afaik)


I agree that Fulcro is a heavy first lift. re-frame offers an easier lift, execellent doc, lots of community support, and lots of jobs.

πŸ‘ 1
Shubham Kumar09:11:49

Thanks @U0PUGPSFR I will checkout re-frame! πŸ™‚


np @U047KCSP20P! I should mention that another candidate is Helix ( but you did not mention React in your skillset. Consider that if you know React. And I have a pure HTML/CSS library mxWeb ( but that lacks the doc and cimmunity of re-frame. A walkthrough: I did start on a learning path for that ( but got side-tracked by ClojureDart! πŸ™‚ Starting again on the trainer and would be happy to coach you through that. Happy Lisping!

πŸ‘ 1
Shubham Kumar05:11:11

Thanks @U0PUGPSFR I'll checkout mxweb-trainer seems like something I can learn by doing and I like that approach

Shubham Kumar05:11:51

Also I did some react so I'll checkout Helix


"I can learn by doing and I like that approach" Right! I hate just reading about a library. But I stopped working on that when ClojureDart was released and spent months on Now I am trying to decide if I should switch the trainer to CLJD/Flutter or continue with the Web version. What would your vote be?

Shubham Kumar08:11:49

I have never used flutter so I cannot comment on that πŸ™‚ but I am sure a lot more experienced folks can tell


FYI, @U047KCSP20P, I am switching to Flutter/MX for my next tutorial/trainer. Btw, I was mistaken, you did mention "a bit of React". I think Helix will be the easiest on-ramp for CLJS UI programming for you. That or re-frame. Check them out and see what feels right?

πŸ‘ 1
Shubham Kumar18:11:42

Thanks a lot @U0PUGPSFR that was really helpful advice!!


;; Hi!
;; I have a list of pages. I want to generate links back and forward where
;; applicable. Is there a function that does something similar to this?

(defn smaller-sequences [coll n])

;; such that I can do something like

(->> (smaller-sequences [1 2 3 4] 3)
     (map (fn [[a b c]]
            {:prev a
             :curr b
             :next c})))
;; =>
[{:prev nil :curr 1 :next 2}
 {:prev 1 :curr 2 :next 3}
 {:prev 2 :curr 3 :next 4}
 {:prev 3 :curr 4 :next nil}]

;; ?

Bob B21:11:13

yeah, partition with some nils on the ends of the collection should do it

πŸ‘ 2
Valentin Mouret21:11:46

(let [numbers '(1 2 3 4 5)]
  (map (fn [prev curr next] {:prev prev :curr curr :next next})
       (conj (butlast numbers) nil)
       (concat (rest numbers) '(nil))))

Valentin Mouret21:11:00

Or something like this. πŸ™‚

πŸ‘ 1

For the record, partition worked great :) Here's the resulting code:

(def slides
  (let [indexes (partition 3 1 (concat [nil] (range (count slides-raw)) [nil]))]
    (mapv (fn [[prev current next] slide]
            (cond-> slide
              true (assoc :i current)
              prev (assoc :prev {:i prev})
              next (assoc :next {:i next})))