aboutsummaryrefslogtreecommitdiff
path: root/tests/guile/de-paul-records-test.scm
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2023-12-13 19:26:46 +0100
committerWojtek Kosior <koszko@koszko.org>2023-12-13 19:26:46 +0100
commit4572f8ae1319af0b6d315399794a5fe9fea7a6fc (patch)
tree37dfba7ddc198b728e40a46c0927fc54559c4f43 /tests/guile/de-paul-records-test.scm
parent0309bc25938747c2570e560509644f1d71308006 (diff)
downloadde-paul-records-4572f8ae1319af0b6d315399794a5fe9fea7a6fc.tar.gz
de-paul-records-4572f8ae1319af0b6d315399794a5fe9fea7a6fc.zip
Add syntax for field updaters.
You can now do (define-immutable-record-type* my-record (counter #:default 0)) (define old-record (my-record (counter 1))) (my-record #:<- old-record (counter #:=> 1+)) or (my-record #:<- old-record (counter #:-> (1+ counter)))
Diffstat (limited to 'tests/guile/de-paul-records-test.scm')
-rw-r--r--tests/guile/de-paul-records-test.scm14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/guile/de-paul-records-test.scm b/tests/guile/de-paul-records-test.scm
index d8970a4..95d1cb3 100644
--- a/tests/guile/de-paul-records-test.scm
+++ b/tests/guile/de-paul-records-test.scm
@@ -74,23 +74,23 @@
(list 'iss? iss? 'is? is?)))
(test-env 'lisp))))
- (test-group "lisp paren-3002"
+ (test-group "lisp paren-3001.1"
(tu:test-equal '#t
(eval
'(begin
- (define %paren-3002
+ (define %paren-3001.1
(lisp #:<- %paren-3001
- (name "paren-3002")
+ (name #:-> (string-append name ".1"))
(is-syntactically-scoped? #t)))
- (match `(a . ,%paren-3002)
+ (match `(a . ,%paren-3001.1)
(`(a . ,($* lisp is-syntactically-scoped?))
is-syntactically-scoped?)))
(test-env 'lisp)))
- (tu:test-equal '(#f "paren-3002")
+ (tu:test-equal '(#f "paren-3001.1")
(eval
- '(match (vector %paren-3002)
+ '(match (vector %paren-3001.1)
(#(($* lisp is-scheme? name))
(list is-scheme? name)))
(test-env 'lisp))))
@@ -122,7 +122,7 @@
;; (*lisp ...) form is a "primitive" variant of the
;; (lisp ...) form — it shall not call the finalizer.
(*lisp #:<- (lisp)
- (name "paren-3004")
+ (name #:=> (const "paren-3004"))
(is-scheme? #t)))
(match %paren-3004