EPrintlns and libs

- Moving all repl prints to stderr
- Adding small functions to module string
This commit is contained in:
teo3300
2024-06-24 00:42:49 +09:00
parent 287b96ea7d
commit d86bd7f7ae
9 changed files with 38 additions and 10 deletions

View File

@ -1,12 +1,18 @@
(def! char (fn* [l]
(car (boom l))))
(def! #n (char "\n"))
(def! #s (char " "))
(def! #t (char "\t"))
(def! char? (fn* [a]
(= (type a) :char)))
(def! string? (fn* [a]
(= (type a) :string)))
(def! strlen (fn* [s] (count (boom s))))
(def! strc (fn* [l]
(def! strc-r (fn* [l s]
(if (empty? l)
@ -38,3 +44,5 @@
(def! chsub (fn* [s c1 c2]
(strc (map-if (fn* [x] (= x c1)) (fn* [x] c2) (boom s)))))