Changeset 15373 for src/Pugs/Eval

Show
Ignore:
Timestamp:
02/27/07 18:56:54 (21 months ago)
Author:
audreyt
Message:

* First step in MO bridge:

vv('12345').reverse # '54321' (newVal)
vv('12345').reverse.reverse # '12345' (newVal)

It's the only method defined (and works) at the moment.
More tomorrow.

Files:
1 modified

Legend:

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

    r15297 r15373  
    1717import Pugs.Config 
    1818import Pugs.Monads 
     19import Pugs.Class 
    1920import qualified Pugs.Val as Val 
    2021import qualified Data.ByteString.Char8 as Buf 
     
    236237                -- callMethod methName [] 
    237238                -- inv ./ meth = ivDispatch inv $ MkMethodInvocation meth (mkArgs []) 
    238                 return . castV $ "CCall " ++ show methName ++ " " ++ show capt 
     239                case invVV of 
     240                    Val.VPure p -> return . runIdentity $ do 
     241                        obj <- mkObj p 
     242                        res <- fromObjBox =<< obj ./ cast methName 
     243                        return . castV $ Val.VPure (res `asTypeOf` p) 
     244                    _       -> do 
     245                        return . castV $ "CCall " ++ show methName ++ " " ++ show capt 
    239246            } 
    240247