about summary refs log tree commit diff stats
path: root/075channel.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-08-20 18:29:09 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-08-20 18:29:09 -0700
commitebea4c3f4a3aed3bb0f6c16edd1d44eea965ca6b (patch)
tree0be5ca83da65d689db6acd0bc36509d046cf0d4f /075channel.mu
parentf09d9076f16dbc8104a8320f54251347b1387d9f (diff)
downloadmu-ebea4c3f4a3aed3bb0f6c16edd1d44eea965ca6b.tar.gz
3231 - reading from fake files in scenarios
Diffstat (limited to '075channel.mu')
-rw-r--r--075channel.mu2
1 files changed, 2 insertions, 0 deletions
diff --git a/075channel.mu b/075channel.mu
index 1ee716a2..72d039a9 100644
--- a/075channel.mu
+++ b/075channel.mu
@@ -67,6 +67,7 @@ def new-channel capacity:number -> in:address:source:_elem, out:address:sink:_el
 def write out:address:sink:_elem, val:_elem -> out:address:sink:_elem [
   local-scope
   load-ingredients
+  assert out, [write to null channel]
   chan:address:channel:_elem <- get *out, chan:offset
   <channel-write-initial>
   {
@@ -97,6 +98,7 @@ def write out:address:sink:_elem, val:_elem -> out:address:sink:_elem [
 def read in:address:source:_elem -> result:_elem, eof?:boolean, in:address:source:_elem [
   local-scope
   load-ingredients
+  assert in, [read on null channel]
   eof? <- copy 0/false  # default result
   chan:address:channel:_elem <- get *in, chan:offset
   {