Welcome, I'm happy to see you here! Feel free to pick a function and add a happy example, the more the merrier!
(one? 1 ) # => true
(map one? [0 1 2 ]) # => @[false true false]
(one? (math/next 1 math/inf )) # => false (trace + )
# <function +>
((trace + ) 5 3 )
# trace (+ 5 3)
# 8
(defn knorkulate [a b ]
((trace + ) a ((trace * ) b b )))
# <function knorkulate>
(knorkulate 2 34 )
# trace (* 34 34)
# trace (+ 2 1156)
# 1158 (->> "X"
(string "a" "b" )
(string "c" "d" )
(string "e" "f" )) # => "efcdabX" $ janet -e '(os/exit 42 )' ; echo $?
42
(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 ] (def h ["a" "b" :c ]) # => ("a" "b" :c)
(find (fn [a ] (= "a" a )) h ) # => "a" (map type [nil true 42 [] @[] {} @{} "a" @"b" 'c :d identity (fn [])])
# => @[:nil :boolean :number :tuple :array :struct :table :string :buffer :symbol :keyword :function :function]
(< ) # -> true
(< 1 ) # -> true
(< 1 2 ) # -> true
(< 2 1 ) # -> false
(< 1 2 3 ) # -> true
(< 1 3 2 ) # -> false
(def a @[1 2 ])
(array/pop a ) # => 2
a # => @[1]
(array/pop a ) # => 1
a # => @[]
(array/pop a ) # => nil
a # => @[]
(brshift 32 2 ) # => 8 (let [len 8
rand-string (string/join (map |(string/format "%02x" $ )
(os/cryptorand len )))]
(= (length rand-string ) (* 2 len )))
# => true
(label result
(each x [0 1 2 3 ]
(when (= x 3 )
(print "reached the end" ))
(when (= x 2 )
(return result 8 ))))
# => 8 (map function? [ even? (fn []) |($ ) file/read -> ])
# => @[ true true true false true ]
(let [tbl @{:a 1 }]
(merge-into tbl {:b 2 })
tbl )
# => @{:a 1 :b 2}
# real-world example: https://git.sr.ht/~subsetpark/bagatto/tree/19aea03fe23fe5486890912df7dc4a936ce617a3/item/main.janet#L23
(all-dynamics )
# => @[:args :err-color :executable :peg-grammar :pretty-format :syspath]
(setdyn :fixed true )
(all-dynamics )
# => @[:args :err-color :executable :fixed :peg-grammar :pretty-format :syspath]