字符串与实用宏

按字符处理 unicode 的字符串工具、对 nil 安全的序列函数,以及 if-let / when-let。

字符串工具按字符(而非字节)处理 unicode。

[(str-upper "zio lisp") (str-replace "a-b-c" "-" "+") (subs "zio-lisp" 4)]

序列函数对 nil 安全(对齐 Clojure),向量进向量出:

[(first nil) (count nil) (map + [1 2] [3 4]) (take 2 [1 2 3])]

when-let / if-let 把"求值一次并判空"变成绑定:

(if-let [user (get {:name "Ada"} :name)]
  (str "hello " user)
  :anonymous)

写过 Common Lisp?defun / defvar / labels / lambda / &optional / &key 这些形状在核心直接可用;dolist / prog1 / ignore-errors 等经 std.cl 兼容层——见CL 兼容层。