Fennel lang memory aid

(, en)

I don’t use Fennel a lot, so when I want to use it, I usually need a quick refresher. Here I’m collecting stuff I always forget.

#$3               ; same as (fn [x y z] z)
#[$1 $2 $3]       ; same as (fn [a b c] [a b c])
#{:a $1 :b $2}    ; same as (fn [a b] {:a a :b b})
#$                ; same as (fn [x] x) (aka the identity function)
#val              ; same as (fn [] val)
#[:one :two $...] ; same as (fn [...] ["one" "two" ...])
(. mytbl myfield)  ; table lookup
(?. mytbl myfield) ; Nil-safe table lookup