您现在的位置是:首页 > 文章详情

Goldfish Scheme v17.11.1 发布,Scheme 解释器

日期:2025-01-08点击:210

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

详情查看:https://gitee.com/LiiiLabs/goldfish/releases/v17.11.1

原文链接:https://www.oschina.net/news/328866
关注公众号

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。

持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。

转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。

文章评论

共有0条评论来说两句吧...

文章二维码

扫描即可查看该文章

点击排行

推荐阅读

最新文章