Releases: LiiiLabs/goldfish
v17.11.8
> bin/goldfish --version
Goldfish Scheme 17.11.8 by LiiiLabs
based on S7 Scheme 11.2 (30-Dec-2024)
Important Updates
- Added the instance method
%+
torich-string
, which can be used for string concatenation. define-case-class
now automatically generates the static method@is-type-of
to determine the type of an object.
($ "This is the first sentence\n"
:+ "This is the second sentence\n"
:+ "This is the third sentence")
(rich-string :is-type-of (rich-string "hello")) ; => #t
Goldfish Scheme v17.11.4
> bin/goldfish --version
Goldfish Scheme 17.11.4 by LiiiLabs
based on S7 Scheme 11.2 (30-Dec-2024)
New Contributors
- Haolin Xu
- Zhiwen Fu
Key New Features
- The
$
syntax sugar can upgrade basic types (boxing) to Goldfish's case class (by Qingyu Chen) - The
@
syntax sugar is used for partial application (by Darcy Shen and Haolin Xu)
Demo snippets
Filtering odd numbers:
(check
(($ 100 :to 128)
:take 10
:map (@ + _ 1)
:filter even?
:collect)
=> '(102 104 106 108 110))
Filtering twin primes:
(define (prime? n)
(cond ((< n 2) #f)
((= n 2) #t)
((even? n) #f)
(else
((rich-list :range 3 (+ ($ n :sqrt) 1) 2)
:forall
(lambda (i) (not (zero? (modulo n i))))))))
(($ 1 :to 100)
:filter prime?
:filter (lambda (x) (prime? (+ x 2)))
:map (lambda (x) (cons x (+ x 2)))
:collect)
v17.11.3
> bin/goldfish --version
Goldfish Scheme 17.11.3 by LiiiLabs
based on S7 Scheme 11.2 (30-Dec-2024)
Goldfish Scheme v17.11.3, the community version of Liii Scheme, will be integrated into the next beta release of Liii STEM. It will be used to connect with DeepSeek, facilitating structured STEM communication between users and large models. Additionally, Goldfish Scheme v17.11.3 will be included in the community edition of Liii STEM, the Mogan STEM Suite v1.2.9.9.
New Contributors
- Yancheng Li
- Xinyi Yu
- Renkai Ge
- Qingyu Chen
Significant Changes
- Case classes have been largely refined, with
%
indicating instance methods and@
indicating static methods. - Instance methods of the
rich-string
case class (such as higher-order functionsmap
andfor-each
) now supportrich-char
parameters with Unicode support. - The
rich-string
case class has added a commonly used function:split
.
Example Code
(((box "2025/02/05/上午/11点") :split "/")
:make-string ":")
; => "2025:02:05:上午:11点"
box
converts the string"2025/02/05/上午/11点"
into arich-string
case class.- Using the
:split
instance method ofrich-string
, the string is split into arich-vector
of length 5. - Using the
:make-string
instance method ofrich-vector
, the delimiter is changed from/
to:
.
Goldfish Scheme v17.11.2
> bin/goldfish --version
Goldfish Scheme 17.11.2 by LiiiLabs
based on S7 Scheme 11.2 (30-Dec-2024)
Goldfish Scheme v17.11.2 will be built-in in Mogan STEM Suite v1.2.9.9.
New Modules (liii lang)
The module improves the usability of Goldfish Scheme significantly
- Functional Data Pipeline like Scala collection or Java Stream API
- Unicode support by
case-string
andcase-char
Demo Code for Unicode support
((box "你好,世界") 0) ; => 你
((box "你好,世界") 4) ; => 界
((box "你好,世界") :length) ; => 5
Demo code for functional data pipelines
((box (list 1 2 3 4 5))
:map (lambda (x) (* x x))
:filter even?
:collect) ; => (list 4 16)
((box (vector 1 2 3 4 5))
:map (lambda (x) (* x x))
:filter even?
:collect) ; => (vector 4 16)
Improved define-case-class
define-case-class
is the Scala case class alternative in Goldfish Scheme. For Goldfish Scheme v17.11.2, the only missing feature for define-case-class
is that generating hash-code method automatically.
(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!"
Goldfish Scheme v17.11.1
> bin/goldfish --version
Goldfish Scheme 17.11.1 by LiiiLabs
based on S7 Scheme 11.2 (30-Dec-2024)
New Modules
- (liii http)
- (liii json)
Demo code to interact with Deepseek provided by SiliconCloud API:
https://github.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
Important New Functions
- typed-define in (liii base) as an enhanced define* with type check
- define-case-class in (liii case) provides a way to define the case class (Scala) in Goldfish Scheme
(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!"
New Contritubors
- Andy Yu
- 邢思宇
- Yifan Lu
- Jiayi Dong
Goldfish Scheme v17.11.0
> bin/goldfish --version
Goldfish Scheme 17.11.0 by LiiiLabs
based on S7 Scheme 11.2 (22-Nov-2024)
S7 Scheme has been upgraded to 11.x
,as a result, the Goldfish Scheme version bumped from 17.10.x
to 17.11.x
.
New Modules
(liii argparse)
(liii alist)
New Functions
- path-getsize in
(liii path)
Goldfish Scheme v17.10.9
Goldfish Scheme 17.10.9 by LiiiLabs
based on S7 Scheme 10.12 (16-Aug-2024)
Goldfish Scheme v17.10.8
Goldfish Scheme 17.10.8 by LiiiLabs
based on S7 Scheme 10.12 (16-Aug-2024)
Goldfish Scheme v17.10.7
> bin/goldfish --version
Goldfish Scheme 17.10.7 by LiiiLabs
based on S7 Scheme 10.12 (16-Aug-2024)
You can use Goldfish Scheme v17.10.7 in Mogan STEM Suite v1.2.9.5.
v17.10.6
> bin/goldfish --version
Goldfish Scheme 17.10.6 by LiiiLabs
based on S7 Scheme 10.12 (16-Aug-2024)
Releases
Add GoldfishLiterateProgramming.pdf
for interacting with GPT services.
New Command Line options
-m
option to choose the mode of pre-defined modules.
New Functions
length=?
,length>?
,length>=?
in(liii list)
New Modules
(liii vector)
(liii comparator)
(srfi srfi-2)
:Provideand-let*