# Copyright 2006-2007 Kevin Reid, under the terms of the MIT X license # found at http://www.opensource.org/licenses/mit-license.html ................ pragma.syntax("0.9") def EventuallyDeepFrozen :()[DeepFrozen."eventually"()] := DeepFrozen."eventually"() def root implements DeepFrozen, ExitViaHere { /** Produces an object to serve as the root of 'extends' chains. It responds 'no such method' to everything, but refers to 'self' in the error instead of the parent-most object. */ to get(self) { return def root1 implements EventuallyDeepFrozen { method __optSealedDispatch(brand) :any { if (brand == EventuallyDeepFrozen.getPeekBrand()) { EventuallyDeepFrozen.getPeekSealer().seal(meta.getState()) } } to __printOn(out :TextWriter) { out.write("") } match [=="__getAllegedType", []] { # Miranda __getAllegedType/0 invokes matchers null.__getAllegedType() } # match [=="__respondsTo", [verb, arity]] { # XXX not proven necessary yet match [verb, args] { # XXX typed exception # XXX have built-in no-such-method give this more useful error throw(`the ${self.__getAllegedType().getFQName()} ${E.toQuote(self)} does not understand $verb/${args.size()} $args`) } } }}