[e-lang] A solution for overriding __getAllegedType

Mark S. Miller markm at cs.jhu.edu
Mon May 22 01:21:48 EDT 2006


Kevin Reid wrote:
> It is sometimes difficult to override __getAllegedType/0  
> appropriately because there is no way to get the original value in  
> order to compute a variation of it.
> 
> To fix this, I have added ObjectExpr#asTypeDesc/0 to E-on-CL, and I  
> propose that the same be done for E-on-Java.
> 
> That is, the Miranda method is this, except in the presence of matchers:
> 
>    to __getAllegedType() :any {
>      return meta.context().getSource().asTypeDesc()
>    }
> 
> For ObjectExprs with fully-qualified names, no matchers, and no  
> explicit __getAllegedType/0 method, this is true:
> 
>    ? objectExpr.asTypeDesc() == objectExpr.eval 
> (scope).__getAllegedType()
>    # value: true


I like it. But what should we do about matchers?


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

     Cheers,
     --MarkM



More information about the e-lang mailing list