# Copyright 2008 Kevin Reid, under the terms of the MIT X license # found at http://www.opensource.org/licenses/mit-license.html ................ ? def makePseudoFarRef := # value: ? def makeWriterStream := # value: These utilities convert eventual references to streams to near streams, and near references are left alone. asNearIn ? def b := EIO.asNearIn(def a := [1].asStream()) # value: [1].asStream() ? b == a # value: true ? def inStreamVow > def inNear := EIO.asNearIn(inStreamVow) # value: This is the best we can do for a chunk type. ? def type := inNear.getChunkType() # value: ? def chunk := inNear.takeAtMost(1) # value: ? bind inStreamVow := [1,2,3].asStream() # value: [1, 2, 3].asStream() ? interp.waitAtTop(chunk) ? chunk # value: [1] ? type # value: ConstList ? inNear.takeAtMost(1) # value: [2] asNearOut ? def b := EIO.asNearOut(def a := makeWriterStream(String, E.call, stdout)) # value: ->(, ...) ? b == a # value: true ? def outStreamVow > def outNear := EIO.asNearOut(outStreamVow) # value: ? def type := outNear.getChunkType() # value: ? def resolver := outNear.reserve() # value: ? bind outStreamVow := a # value: ->(, ...) ? resolver # value: ? resolver.resolve("ping. ") # stdout: ping.