From a5066eceaf444bc8c56d50fbe33ff4e3f1a049e2 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Thu, 6 Jun 2019 18:37:18 -0400 Subject: [PATCH] Migrate test code here --- libs/test-atoms.scm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 libs/test-atoms.scm diff --git a/libs/test-atoms.scm b/libs/test-atoms.scm new file mode 100644 index 00000000..cba5e210 --- /dev/null +++ b/libs/test-atoms.scm @@ -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)) + ))