Welcome, I'm happy to see you here! Feel free to pick a function and add a happy example, the more the merrier!
(last "hello" )
# => 111
(map type [nil true 42 [] @[] {} @{} "a" @"b" 'c :d identity (fn [])])
# => @[:nil :boolean :number :tuple :array :struct :table :string :buffer :symbol :keyword :function :function]
(fiber? (fiber/new (fn [])))
# => true
(os/shell "uptime > /tmp/uptime.txt" ) # => 0
(slurp "/tmp/uptime.txt" )
# => @"22:33 up 5 days, 9:34, 15 users, load averages: 1.93 1.74 1.59\n"
(os/rm "/tmp/uptime.txt" ) # => nil (put (table ) :a 1 ) # => @{:a 1}
(map boolean? [true false nil 0 1 ])
# => @[true true false false false]
# Note that the earlier sort func is executed later
(update @{:data @[:cherry :orange ]} :data (comp sort |(array/push $ :apple )))
# => @{:data @[:apple :cherry :orange]} # https://en.wikipedia.org/wiki/Error_function
(math/erf 1 )
# => 0.842701 (net/address "0.0.0.0" 80 ) # => <core/socket-address 0x55CABA438E90>
(net/address "0.0.0.0" 8989 ) # => <core/socket-address 0x55CABA439980>
(let [a 1 b 2 c 3 ] (+ a b c )) # => 6
(let
[a 1
b (+ a 1 )
c (+ b 1 )]
(+ a b c )) # => 6
In order to use :fresh , write:
(import path :fresh true )(math/atan 1 ) # 0.785398
(math/atan 0.5 ) # 0.463648 (take 2 [1 -2 2 3 9 -10 ]) # (1 -2) (freeze @{:a @[1 2 ]
:b @{:x @[8 9 ]
:y :smile }})
# => {:a (1 2) :b {:x (8 9) :y :smile}} (int/u64 42 ) # => <core/u64 42>
(int/u64 42.1 ) # => <core/u64 42>
(int/u64 "42" ) # => <core/u64 42>