mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-19 05:39:17 +02:00
Migrate test code here
This commit is contained in:
parent
f2b8bde190
commit
a5066eceaf
1 changed files with 27 additions and 0 deletions
27
libs/test-atoms.scm
Normal file
27
libs/test-atoms.scm
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
(import
|
||||||
|
(scheme base)
|
||||||
|
(scheme write)
|
||||||
|
(cyclone concurrency)
|
||||||
|
)
|
||||||
|
|
||||||
|
(define lis '(1 2))
|
||||||
|
(define a (make-atom lis))
|
||||||
|
(write
|
||||||
|
(list
|
||||||
|
a
|
||||||
|
(ref a)
|
||||||
|
(compare-and-set! a 1 lis)
|
||||||
|
(ref a)
|
||||||
|
(compare-and-set! a lis 1)
|
||||||
|
(ref a)
|
||||||
|
))
|
||||||
|
(newline)
|
||||||
|
(write
|
||||||
|
(list
|
||||||
|
(make-shared '(1 (2 (3))))
|
||||||
|
(make-shared 1)
|
||||||
|
(make-shared 1.0)
|
||||||
|
(make-shared "this is a string")
|
||||||
|
(make-shared #(a b c d))
|
||||||
|
(make-shared #u8(1 2 3 4))
|
||||||
|
))
|
Loading…
Add table
Reference in a new issue