Changeset 13005 for src/Pugs/Eval

Show
Ignore:
Timestamp:
09/04/06 05:22:48 (2 years ago)
Author:
audreyt
Message:

* Initial support for dispatch quantifier:

class C { method foo { 1 } };
class D is C { method foo { 2 } };
my $meth = 'foo';
my $obj = D.new;
$obj.*$meth; # (1, 2)

Currently only the .*$meth form is supported; also the return
value (an unconcatenated list of each method's return value)
is as of yet unspecced.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Eval/Var.hs

    r12871 r13005  
    154154_SUPER = __"SUPER" 
    155155 
     156_NEXT :: ByteString 
     157_NEXT = __"NEXT" 
     158 
     159 
    156160findSub :: Var        -- ^ Name, with leading @\&@. 
    157161        -> Maybe Exp  -- ^ Invocant 
     
    172176        pkg <- asks envPackage 
    173177        findSuperSub pkg var' 
     178    | Just var' <- dropVarPkg _NEXT _var = do 
     179        typ <- evalInvType _inv 
     180        findSuperSub (cast typ) var' 
    174181    | otherwise = do 
    175182        findBuiltinSub NoMatchingMulti _var