Welcome, I'm happy to see you here! Feel free to pick a function and add a happy example, the more the merrier!
(do
(def before (dyn :expression ))
(setdyn :expression :smile )
[before (dyn :expression )])
# => '(nil :smile) (take 2 [1 -2 2 3 9 -10 ]) # (1 -2) (let [a 1 ]
(let [b a ]
b )) # => 1
(string/split "," "bruce,scott,tiger,woods" )
# => @["bruce" "scott" "tiger" "woods"] (loop [i :range [0 12 ]]
(print i ))
# => 0
# => 1
# => 2
# => 3
# => 4
# => 5
# => 6
# => 7
# => 8
# => 9
# => 10
# => 11
# => nil
(peg/find ':s "Battery temperature: 40 °C" )
# => 7 index of the first whitespace character
# :s (set " \t\r\n\0\f\v")
(int/s64 42 ) # => <core/s64 42>
(int/s64 42.1 ) # => <core/s64 42>
(int/s64 "42" ) # => <core/s64 42>
(in :yo 0 )
# => 121
(let [c (ev/chan 1 )
before (ev/count c )]
(ev/give c :hi )
[before (ev/count c )])
# =>
'(0 1 )(ev/spawn (os/sleep 1 ) (print "Hard work is done!" ))
# prints "Hard work is done!" after one second
# this is the easiest way to put some forms on the event loop
# but do not forget REPL is blocking, for now, so run the example with `janet -e` # note that os/touch does not create a file if it does not yet exist.
(os/touch "foo" )
error: No such file or directory
in os/touch
in _thunk [repl ] (tailcall ) on line 2 , column 1
(map dictionary? [ 'ab :ab "ab" @"ab" [97 98 ] @[97 98 ] {0 97 1 98 } @{0 97 1 98 } ])
# => @[ false false false false false false true true ]
(map struct? [ 'ab :ab "ab" @"ab" [97 98 ] @[97 98 ] {0 97 1 98 } @{0 97 1 98 } ])
# => @[ false false false false false false true false ]
(map table? [ 'ab :ab "ab" @"ab" [97 98 ] @[97 98 ] {0 97 1 98 } @{0 97 1 98 } ])
# => @[ false false false false false false false true ] (sorted [1 -2 2 3 9 -10 ]) # @[-10 -2 1 2 3 9] (eachk k [1 2 3 ] (print k ))
# prints 0
# prints 1
# prints 2
# for indexed collections indices are printed (filter identity [1 true 2 3 nil 4 false ])
# => @[1 true 2 3 4]