Goldfish Scheme v17.11.1 发布,Scheme 解释器
Goldfish Scheme v17.11.1 已经发布,Scheme 解释器。
此版本更新内容包括:
> bin/goldfish --version
Goldfish Scheme 17.11.1 by LiiiLabs
based on S7 Scheme 11.2 (30-Dec-2024)
新模块
- (liii http)
- (liii json)
使用硅基流动的API和Deepseek交互的示例代码: https://gitcode.com/LiiiLabs/goldfish/blob/v17.11.1/http/tests/chat_demo.scm
git clone https://github.com/LiiiLabs/goldfish.git
xmake config --http=y --yes -vD
xmake b http
bin/http -l http/tests/chat_demo.scm
重要的新函数
(liii base)中的typed-define:支持类型校验和具名参数,是define*的加强版(liii case)中的define-case-class: 提供定义类似Scala语言中的case class的功能
(define-case-class person
((name string?)
(age integer?))
(define (to-string)
(string-append "I am " name " " (number->string age) " years old!"))
(define (greet x)
(string-append "Hi " x ", " (to-string))))
(define bob (person "Bob" 21))
(bob 'to-string) => "I am Bob 21 years old!"
(bob 'greet "Alice") => "Hi Alice, I am Bob 21 years old!"
新贡献者
- Andy Yu
- 邢思宇
- Yifan Lu
- Jiayi Dong