"The ground wire is an additional path for electrical current to return safely to the ground without danger to anyone in the event of a short circuit."
(nsdemo.core
(:require [ground.core :refer:all]))The n-> and n->> threading macros allow for predicates and side effects within their forms.
n? signals a predicate that will pass through the result of the
prior expression if true and return nil for the entire form if false
(n->6
(n? (>5))
(vector78)) => [678]
(n->9
(n? (>10))
(vector1112)) => nil(n->> [123]
(n? (every? identity))
(map inc)) => '(234)
(n->> [1nil3]
(n? (every? identity))
(map inc)) => niln! signals a side effect, such as printing or logging, that will
always pass through the result of the prior expression
(n->4
(n! (println"is the best number")) ;; prints "4 is the best number"
inc) => 5 (n->> ["right""blue""humpback"]
(n! (apply println "These are different types of whales:")) ;; prints "These are different types of whales: right blue humpback"
sort) => '("blue""humpback""right")