Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Throw in Clojure into the mix, and you get superpowers!


I'm still trying to mentally grok the Clojure model and syntax hah. On my todo list. Clojure users seem to love it though. Do you have a tutorial that could sell it to me?


My Clojure AI book won't teach you the language, but afterward you read through a tutorial my book contains interesting examples; read it online https://leanpub.com/clojureai/read


Many Clojure tutorials are free! It's difficult to say without knowing nothing about your preference and experience. Everyone's welcome to join Clojure Slack community (for example) which has several tens of thousands of members and dedicated beginners channel. I'm sure if you asked there, you'd get tons of recommendations tailored to you. https://clojurians.slack.com/

(BTW Clojure, as a Lisp dialect, has almost no syntax. You can learn THAT in 5 minutes. The challenge is in training your programming mind to think in totally new concepts)


For syntax, maybe this general Lisp advice will help: consider a normal function call, like f(a, b). To make this into a Lisp function call, drop the unnecessary comma (whitespace is enough to separate tokens) like f(a b), and then move the function name inside the parentheses, like (f a b). Applying operators that are considered "primitive" in other languages are syntactically treated the same as functions. So imagine an add function like add(a, b), but instead of being named 'add', it's just named '+', like +(a, b). Applying the same transformation as before, this turns into (+ a b).

Using the function application syntax for primitives like + is nice because you get the same flexibility of normal functions, like variable argument length: (+ a b c).

Clojure is a little bit less uniform than other Lispy languages in that it has special brackets for lists (square brackets) and for maps (curly brackets), but that's pretty much it.


it also has the threading operator or macro.

i am not a clojure or lisp expert, just saying.


Clojure style threading macros are readily available for common lisp and scheme. Probably emacs lisp too.


interesting, thanks.


"Clojure for the Brave and True" is free online: https://www.braveclojure.com/clojure-for-the-brave-and-true/


Start doing any year of Advent of Code with Clojure and you'll get it.

They're really amenable to the REPL.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: