# Copyright 2008 Kevin Reid, under the terms of the MIT X license # found at http://www.opensource.org/licenses/mit-license.html ................ ? def SubrangeGuard :DeepFrozen := # value: SubrangeGuard ? def t := int; def int :([t]) := t; null (int in the safeScope is a LazyEvalSlot and doesn't reveal its value (yet?), so we rebind it as a FinalSlot. XXX this is unpleasant) ? def SGInt :DeepFrozen := SubrangeGuard[int] # value: SubrangeGuard[int] ? Selfless.passes(SGInt) # value: true ? def Gzero implements SGInt {} # problem: __main$Gzero has no coerce/2 method ? def Gnoco implements SGInt { to coerce(foo, bar) { > return foo > }} # problem: __main$Gnoco does not have a determinable result guard, but <& any> :Same[<& any>] ? def Gresult implements SGInt { to coerce(specimen, ejector) :int { > return 42 > }} # value: ? def Gbroader implements SubrangeGuard[DeepFrozen] { > to coerce(specimen, ejector) :int { > return 42 > }} # value: