[e-lang] Idea: generic makers for PBC

Kevin Reid kpreid at mac.com
Mon Jan 15 16:54:15 CST 2007


On Jan 15, 2007, at 16:32, Mark S. Miller wrote:
> Kevin Reid wrote:
>> I therefore propose a separate loader; I have no name for it at the
>> moment. This loader might or might not use the same source/namespace
>> as <import>. Its distinguishing properties are:
>>
>>    - It is PassByCopy by way of being an exit (in Data-E terms).
>>    - It will return a maker for any name requested.
>>
>> If asked for a FQN it doesn't know, it will return a 'generic'  
>> object.
>>
>> def makeGeneric(uncall) {
>>    def generic implements pbc {
>>      to __optUncall() { return uncall }
>>      match [verb, args] { makeGeneric([generic, verb, args]) }
>>    }
>> }
>
> I don't understand the proposal. When the loader in question is  
> asked for an FQN it doesn't know, it returns a 'generic' object  
> with what uncall triple? Where does the uncall argument for the  
> first call to makeGeneric come from?

def loaderUnderDiscussion {
   to get(name) {
     return if (...) {
       ...
     } else {
       makeGeneric(loaderUnderDiscussion, "get", [name])
     }
   }
}

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




More information about the e-lang mailing list