[e-lang] Idea: How to do <import>.optUncall for emakers

Kevin Reid kpreid at mac.com
Wed Mar 21 15:06:25 CDT 2007


? <import>.optUncall(__makeTwine)
# value: [<import>, "get", ["org.erights.e.elib.tables.makeTwine"]]

? <import>.optUncall(__makeOrderedSpace)
# value: null

It would be useful to have <import> uncalls for emaker-based objects,  
as this avoids the complexity of the object exposing <import> via  
__optUncall and needing to determine its own FQN.

Any mechanism for doing so must avoid breaking the observed  
immutability of <import>'s behavior by allowing an emaker producing  
an already existant object to change the <import>.optUncall for that  
object.

Proposal:

1. <import> maintains a weak-key hash table mapping objects to import  
names (FQNs).

2. If <import>.optUncall does not find an entry in that table, it  
inserts an entry in the table mapping the object to a failure marker.

3. Any object returned by an emaker which is cached by <import> (i.e.  
DeepFrozen) and Selfish is inserted in the table, unless there is  
already an entry, in which case there is no effect.

These rules ensure that <import>.optUncall can never change its  
answer for any particular object.

Does anyone see any problem with this, besides that it won't work for  
E-implemented objects without DeepFrozen auditing?

-- 
Kevin Reid                            <http://homepage.mac.com/kpreid/>




More information about the e-lang mailing list