# Copyright 2005 Kevin Reid, under the terms of the MIT X license # found at http://www.opensource.org/licenses/mit-license.html ................ pragma.enable("easy-return") pragma.disable("explicit-result-guard") # XXX support File as lazy-value #def File := /** Return a read-only facet on a standard file-protocol object. */ def makeReadOnlyFile { # implements DeepFrozen (fails because DeepFrozen uses this!) to run(rwFile) { def readOnlyFile { # implements File # XXX all appropriate methods # to readOnly() :File { return readOnlyFile } # to shallowReadOnly() :File { return readOnlyFile } to exists() :boolean { return rwFile.exists() } to getText() :String { return rwFile.getText() } to getTwine() :Twine { return rwFile.getTwine() } } return readOnlyFile } } # XXX tests for this