Welcome, I'm happy to see you here! Feel free to pick a function and add a happy example, the more the merrier!
(-> "X"
(string "a" "b" )
(string "c" "d" )
(string "e" "f" )) # => "Xabcdef" (not= [1 1 ] [1 1 ]) # => false
(not= [1 1 ] [2 3 ]) # => true
(not= [1 1 ] @[1 1 ]) # => true
(not= [1 1 ] @[2 3 ]) # => true
(not= @[1 1 ] @[1 1 ]) # => true
(not= @[1 1 ] @[2 3 ]) # => true
(deep-not= [1 1 ] [1 1 ]) # => nil
(deep-not= [1 1 ] [2 3 ]) # => true
(deep-not= [1 1 ] @[1 1 ]) # => true
(deep-not= [1 1 ] @[2 3 ]) # => true
(deep-not= @[1 1 ] @[1 1 ]) # => nil
(deep-not= @[1 1 ] @[2 3 ]) # => true (> 12 11 10 9 8 7 6 5 4 3 2 1 ) # => true
(> 12 11 10 9 8 7 6 5 4 3 2 9 ) # => false (math/exp 1 ) # => 2.71828
math/e # => 2.71828 (var abc 123 )
(= 356 (with-vars [abc 456 ] (- abc 100 )))(mod 13 5 ) # 3 (parse "[:a :b :c]" ) # => [:a :b :c] (string/check-set "0123456789abcdef" "deadbeef" ) # => true (empty? : )
# => true (from-pairs [[:hello "world" ] [:foo "bar" ]])
# => @{:foo "bar" :hello "world"} # from https://janet.guide/control-flow/
(defn calculate [expr ]
(match expr
[:add x y ] (+ x y )
[:subtract x y ] (- x y )
[:multiply x y ] (* x y )
([:divide x y ] (= y 0 )) (error "division by zero!" )
[:divide x y ] (/ x y )))
(calculate [:subtract 5 10 ])
# Note, it checks prefixes, so you must order things this way:
(match [1 2 ]
[x y z ] "three elements"
[x y ] "two elements"
[x ] "one element"
[] "no elements" )(->> "X"
(string "a" "b" )
(string "c" "d" )
(string "e" "f" )) # => "efcdabX" (array 1 2.3 :a "foo" true nil [] {} (fn []))
# => @[1 2.3 :a "foo" true nil () {} <function 0x7FB2A3F02170>] (var x 1 )
(loop [n :range-to [1 5 ]]
(*= x n ))
x # => 120 # Convert an array of k/v pairs into a table
(def kvp @[[:foo 1 ] [:bar 2 ]])
(table ;(mapcat identity kvp )) # => @{:foo 1 :bar 2}