From 9f7087bf74c49ba96da57e37ea8ff15d1d852af4 Mon Sep 17 00:00:00 2001 From: Nathanne Isip Date: Sat, 21 Dec 2024 13:05:01 +0800 Subject: [PATCH] Lock example file script snippet. --- test/lock.n8 | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/lock.n8 diff --git a/test/lock.n8 b/test/lock.n8 new file mode 100644 index 0000000..11618c4 --- /dev/null +++ b/test/lock.n8 @@ -0,0 +1,12 @@ +#!/opt/n8lang/bin/n8 + +val x = 3.14 +lock(x) { + render! "Value of x inside lock is: " + x + x = 2.71 + render! "Value of x inside lock after attempted update is: " + x +} + +render! "Value of x outside lock is: " + x +x = 1.61 +render! "Value of x outside lock after attempted update is: " + x