Clojure Macros Tutorial - part 2: how not to write macros
After having understood the fundamental difference between functions and macros, we are now ready to write our first macro.
Developer. Author. Speaker.
After having understood the fundamental difference between functions and macros, we are now ready to write our first macro.
Clojure as any other LISP language is homoiconic: the code written in the language is encoded as data structures that the language has tools to manipulate.
In clojure, records, types and protocols are parts of the fundamental building blocks of the language. We have talked about defrecord here: records are wacky maps and we have unveiled deprotocol secret there: defprotocol’s secret.
In clojure, records, types and protocols are parts of the fundamental building blocks of the language.
Generating the Fibonacci sequence is a good exercise to illustrate the concept of lazy sequences in Clojure. In this article, we will present 3 ways to create a lazy Fibonacci sequence:
;; this is a workaround: currently a page with only transpiled snippets dont work (+ 1 2)
In this magic post, we showed how to make a type in clojurescript behave like a function by extending the IFn protocol.
In this precedent post we have presented the skeleton of the javascript transpiled code of defrecord + deftype when they work together.
In Clojure, the language itself is modifiable
ClojureScript can compile itself