function
boot.janet on line 776 , column 1
(comp & functions )
Takes multiple functions and returns a function that is the
composition of those functions.
# Note that the earlier sort func is executed later
(update @{:data @[:cherry :orange ]} :data (comp sort |(array/push $ :apple )))
# => @{:data @[:apple :cherry :orange]}
(defn square [x ] ( x x ))
(defn square-then-dec [x ] ((comp dec square ) x ))
(defn dec-then-square [x ] ((comp square dec ) x ))
(square-then-dec 3 ) # => 8
(dec-then-square 3 ) # => 4