Welcome, I'm happy to see you here! Feel free to pick a function and add a happy example, the more the merrier!
(keyword "" )
# => : (forever
(print "and then?" )
(ev/sleep 1 )
(print "no and then!" ))
# => and then?
# sleeps for one second
# => no and then!
# => and then?
# sleeps for one second
# => no and then!
# ... (let [a 1 ]
(let [b a ]
b )) # => 1
(math/atan 1 ) # 0.785398
(math/atan 0.5 ) # 0.463648 (+ 1 2 3 ) # => 6
(sum [1 2 3 ]) # => 6 (filter (fn [x ] (> x 2 )) [1 2 3 4 5 ]) # @[3 4 5] # In Linux, "everything is a file" so:
(def pid (os/getpid ))
pid
# =>
367537
(def statm-path (string "/proc/" pid "/statm" ))
statm-path
# =>
"/proc/367537/statm"
(slurp statm-path )
# =>
@"1380 971 683 82 0 362 0\n" (reduce (fn [s1 s2 ]
(string "[" s1 "+" s2 "]" ))
"x"
["a" "b" "c" ])
#=> "[[[x+a]+b]+c]"
(map false? [ false nil true 0 1 42 'a :a "a" [97 ] {:a 42 } (fn []) ])
# => @[ true false false false false false false false false false false false ]
# based on: https://codeberg.org/veqq/janetdocs/src/commit/54a964d1a35920af2655c4932a9b51379e8b9380/seed.janet#L16
(def core-api (all-bindings ))
(def alldocs @[])
(loop [b :in core-api ]
(when (not= "allbindings" (string b ))
(do
(def buf @"" )
(with-dyns [:out buf ]
(doc* b )
(array/push alldocs {:name (string b ) :docstring (string buf )})))))
(pp alldocs )(partition-by even? [1 1 2 3 5 8 13 21 ])
# => @[@[1 1] @[2] @[3 5] @[8] @[13 21]]
(defn dataframe
``Create an empty dataframe with the given columns``
[& columns ]
(tabseq [c :in columns ] c @[]))# with by function
(sorted [1 -2 2 3 9 -10 ] > ) #@[9 3 2 1 -2 -10] (def a @[23 42 ])
(array/clear a )
(pp a )
# => prints @[] (<= 1 2 3 ) # => true
(<= 1 2 1 ) # => false