[e-lang] <import> with cycle breaking is not DeepFrozen

Mark S. Miller markm at cs.jhu.edu
Mon May 22 00:51:39 EDT 2006


I like:

> Proposal #2:
> 
> Make <import> not marked DeepFrozen.
> 
> Anything which is to be DeepFrozen would need to not refer to  
> <import>. I'm not sure how bad this would be.


Even with the restriction of proposal #1, <import> isn't really DeepFrozen
anyway, since it depends on the state of the filesystem at the time a module
is first imported.

I've been thinking about how to represent KeyKOS's notion of "Sensory", aka
DeepReadOnly, as an auditable property in E. <import> really is
deeply-read-only, and could be audited or deemed so without cheating.


# In the following demo code, "Honest" really means "if you ask an honest
# object for a Sensory form of itself, it will either do so or fail, but in
# neither case will this request affect the honest object's state.


def makeHonestSlot(var value) :Honest {
     def sensorySlot implements Sensory {
         to getValue() :Sensory { return value }
     }
     def honestSlot implements Honest {
         to getValue() { return value }
         to setValue(newValue) { value := newValue }
         to __conformTo(guard) {
             if (guard == Sensory) {
                 return sensorySlot
             } else {
                 return null
             }
         }
     }
     return honestSlot
}

def Sensory {
     to coerce(specimen, optEjector) {
         if (__auditedBy(specimen, Sensory) {
             return specimen
         } else if (__auditedBy(specimen, Honest)) {
             return specimen.__conformTo(Sensory)
         } else {
             throw.eject(optEjector, "oops")
         }
     }
}


-- 
Text by me above is hereby placed in the public domain

     Cheers,
     --MarkM



More information about the e-lang mailing list