# Copyright 2005-2007 Kevin Reid, under the terms of the MIT X license # found at http://www.opensource.org/licenses/mit-license.html ................ ConstList streams ? pragma.enable("dot-props") > def ALL := EIO::ALL ? def text := "Teh quike bruin fax jimp't ovah thy lizy dugz." # value: "Teh quike bruin fax jimp't ovah thy lizy dugz." ? def s := text.asStream() # value: "Teh quike bruin fax \...".asStream() ? s.getChunkType() # value: String ? s.takeAtMost(10) # value: "Teh quike " ? s # value: "bruin fax jimp't ova\...".asStream() ? s.takeAtMost(ALL) # value: "bruin fax jimp't ovah thy lizy dugz." ? s # value: "".asStream() ? [s.takeAtMost(1)] # value: [null] List stream fail/1 ? def s := text.asStream() > s.fail("foo") > s # value: "".asStream() ? [s.takeAtMost(1)] # value: [null] List stream close/0 ? def s := text.asStream() > s.close() > s # value: "".asStream() ? [s.takeAtMost(1)] # value: [null] XXX Should FlexLists have asStream? If so, what would it mean? XXX all varieties of map streams (pairs, values, keys)? XXX Set streams XXX turning streams into tables XXX other stream methods