about summary refs log tree commit diff stats
path: root/088file.mu
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-06-17 11:20:53 -0700
committerKartik Agaram <vc@akkartik.com>2018-06-17 15:57:37 -0700
commit01ce563dfe3e6cf58337708b9dbb60a8a99fa0f2 (patch)
tree696fce7bb207e77952d10b7358f4ce00faed3874 /088file.mu
parentdd66068298b0a11f2a1f195376cba98e0c8570b5 (diff)
downloadmu-01ce563dfe3e6cf58337708b9dbb60a8a99fa0f2.tar.gz
4262 - literal 'null'
Diffstat (limited to '088file.mu')
-rw-r--r--088file.mu10
1 files changed, 5 insertions, 5 deletions
diff --git a/088file.mu b/088file.mu
index d9c3391d..da3e35d3 100644
--- a/088file.mu
+++ b/088file.mu
@@ -30,7 +30,7 @@ def start-reading resources:&:resources, filename:text -> contents:&:source:char
   }
   # real file system
   file:num <- $open-file-for-reading filename
-  return-unless file, 0/contents, true/error
+  return-unless file, null/no-contents, true/error
   contents:&:source:char, sink:&:sink:char <- new-channel 30
   start-running receive-from-file file, sink
 ]
@@ -39,7 +39,7 @@ def slurp resources:&:resources, filename:text -> contents:text, error?:bool [
   local-scope
   load-inputs
   source:&:source:char, error?:bool <- start-reading resources, filename
-  return-if error?, 0/contents
+  return-if error?, null/no-contents
   buf:&:buffer:char <- new-buffer 30/capacity
   {
     c:char, done?:bool, source <- read source
@@ -70,7 +70,7 @@ def start-reading-from-fake-resource resources:&:resources, resource:text -> con
     start-running receive-from-text curr-contents, sink
     return
   }
-  return 0/not-found, true/error-found
+  return null/no-such-resource, true/error-found
 ]
 
 def receive-from-file file:num, sink:&:sink:char -> sink:&:sink:char [
@@ -115,7 +115,7 @@ def start-writing resources:&:resources, filename:text -> sink:&:sink:char, rout
   }
   # real file system
   file:num <- $open-file-for-writing filename
-  return-unless file, 0/sink, 0/routine-id, true/error
+  return-unless file, null/sink, 0/routine-id, true/error
   {
     break-if file
     msg:text <- append [no such file: ] filename
@@ -175,7 +175,7 @@ def transmit-to-fake-resource resources:&:resources, filename:text, source:&:sou
   contents:text <- buffer-to-array buf
   new-resource:resource <- merge filename, contents
   # write to resources
-  curr-filename:text <- copy 0
+  curr-filename:text <- copy null
   data:&:@:resource <- get *resources, data:offset
   # replace file contents if it already exists
   i:num <- copy 0