Skip to content

Liii 库

Liii 库是 Goldfish Scheme 的核心扩展,提供类似 Python 的丰富功能。

基础库

描述主要功能
(liii base)基础例程==, !=, display*, compose, identity
(liii error)错误处理os-error, type-error, value-error
(liii check)测试框架check, check-catch, check-report

数据结构

描述主要功能
(liii list)列表库list-view, fold, flatten, list-take
(liii vector)向量库vector-index, vector-fold
(liii string)字符串库string-join, string-split
(liii hash-table)哈希表库hash-table-empty?, hash-table-contains?

系统与 IO

描述主要功能
(liii sys)系统模块argv, exit
(liii os)操作系统getenv, mkdir, listdir
(liii path)路径操作path-dir?, path-file?, path-join

网络与数据

描述主要功能
(liii http)HTTP 客户端http-get, http-post, http-head
(liii json)JSON 处理string->json, json->string
(liii uuid)UUID 生成uuid4

函数式编程

描述主要功能
(liii case)模式匹配case*
(liii option)Option 类型option?, option-map, option-flatten
(liii either)Either 类型left?, right?, either-map
(liii range)Range 库numeric-range, iota

其他

描述主要功能
(liii bitwise)位运算bitwise-and, bitwise-or

使用示例

scheme
(import (liii base)
        (liii list)
        (liii string)
        (liii os))

;; 组合使用
(string-join
  (map number->string
       (iota 5))
  ", ")
;; => "0, 1, 2, 3, 4"

;; 环境变量
(getenv "HOME")

基于 Apache 2.0 许可发布