Welcome, I'm happy to see you here! Feel free to pick a function and add a happy example, the more the merrier!
# on a Core i5-4590:
(os/arch ) # => :x64
# on an Intel Atom N270:
(os/arch ) # => :x86
# on a raspberry pi:
(os/arch ) # => :arm (def a @[])
(array/insert a 1 :a ) # error: index out of range
(array/insert a -2 :a ) # error: index out of range
(seq [v :in (coro
(yield :hi )
(yield :bye ))]
v )
# => @[:hi :bye] (net/address "0.0.0.0" 80 ) # => <core/socket-address 0x55CABA438E90>
(net/address "0.0.0.0" 8989 ) # => <core/socket-address 0x55CABA439980>
(symbol "foo" ) # => foo
(def a "foo" )
(symbol a ) # => foo
(symbol a 42 nil ) # => foo42nil
(bxor 2r011 2r110 )
# => 5
# note that 'not' works as an implementation of 'falsey?'
(map not [ nil false true 0 1 'a :a "a" [] {} (fn []) ])
# => @[ true true false false false false false false false false false ]
(map truthy? [ nil false true 0 1 'a :a "a" [] {} (fn []) ])
# => @[ false false true true true true true true true true true ]
(math/rng-uniform (math/rng 0 ))
# => 0.487181
(-> 1 (< 2 )) # -> true
(->> 1 (< 2 )) # -> false (string/check-set "0123456789abcdef" "deadbeef" ) # => true (defmacro timeit [& body ]
# generate unique symbols to use in the macro so they can't conflict with anything used in `body`
(with-syms [$t0 $t1 ]
~(do
(def $t0 (os/clock :monotonic :double ))
(do ,;body )
(def $t1 (os/clock :monotonic :double ))
(- $t1 $t0 ))))
(def time-taken (timeit (os/sleep 0.5 )))
(printf "Took %.3f seconds" time-taken )
(update @{:a 1 } :a inc )
# => @{:a 2}
(map truthy? [ nil false true 0 1 'a :a "a" [] {} (fn []) ])
# => @[ false false true true true true true true true true true ]
# note that 'not' works as an implementation of 'falsey?'
(map not [ nil false true 0 1 'a :a "a" [] {} (fn []) ])
# => @[ true true false false false false false false false false false ]
(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
(def b @"" )
(xprin b "HOHOHO" )
# => nil
b
# => "HOHOHO"