about summary refs log tree commit diff stats
path: root/chessboard.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-01-25 16:40:11 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-01-25 16:40:11 -0800
commit4f686be1ebb6713933298531531fbef0898c6b2b (patch)
tree3a46478c288a8b6fa835c16882363f41a5c891f4 /chessboard.mu
parentd1f57fa1ab95a36a562d2b75a064bc387bd2d5d3 (diff)
downloadmu-4f686be1ebb6713933298531531fbef0898c6b2b.tar.gz
623 - 'nochange' to guard against race conditions
I dunno, this may all be a wild goose chase. I haven't been disciplined
in tagging in-out arguments in 'read-move' and its helpers. Maybe I
should just drop those 'nochange' oargs in 'read' and 'write'. Maybe I
should reserve output args only for return values that callers might
actually care about, and use more conventional metadata like 'const' or
'unique' or 'inout' on other args.
Diffstat (limited to 'chessboard.mu')
-rw-r--r--chessboard.mu6
1 files changed, 3 insertions, 3 deletions
diff --git a/chessboard.mu b/chessboard.mu
index b26401ab..8177a403 100644
--- a/chessboard.mu
+++ b/chessboard.mu
@@ -127,7 +127,7 @@
 (function read-file [
   (default-space:space-address <- new space:literal 30:literal)
   (stdin:channel-address <- next-input)
-  (x:tagged-value stdin:channel-address/deref <- read stdin:channel-address)
+  (x:tagged-value stdin:channel-address/deref/nochange <- read stdin:channel-address)
 ;?   (print-primitive-to-host x:tagged-value) ;? 1
 ;?   (print-primitive-to-host (("\n" literal))) ;? 1
   (a:character <- copy ((#\a literal)))
@@ -154,7 +154,7 @@
 (function read-rank [
   (default-space:space-address <- new space:literal 30:literal)
   (stdin:channel-address <- next-input)
-  (x:tagged-value stdin:channel-address/deref <- read stdin:channel-address)
+  (x:tagged-value stdin:channel-address/deref/nochange <- read stdin:channel-address)
   (c:character <- maybe-coerce x:tagged-value character:literal)
 ;?   (print-primitive-to-host (("BBB " literal))) ;? 1
 ;?   (print-primitive-to-host c:character) ;? 1
@@ -180,7 +180,7 @@
 (function expect-stdin [
   (default-space:space-address <- new space:literal 30:literal)
   (stdin:channel-address <- next-input)
-  (x:tagged-value stdin:channel-address/deref <- read stdin:channel-address)
+  (x:tagged-value stdin:channel-address/deref/nochange <- read stdin:channel-address)
   (c:character <- maybe-coerce x:tagged-value character:literal)
   (expected:character <- next-input)
   (match?:boolean <- equal c:character expected:character)