mirror of
https://github.com/teo3300/rust-mal.git
synced 2026-01-12 01:05:32 +01:00
EPrintlns and libs
- Moving all repl prints to stderr - Adding small functions to module string
This commit is contained in:
@ -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)))))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user