Changeset 2957
- Timestamp:
- 05/11/05 02:32:56 (4 years ago)
- svk:copy_cache_prev:
- 4498
- Files:
-
- 5 modified
-
src/Pugs/AST.hs (modified) (1 diff)
-
src/Pugs/AST/Internals.hs (modified) (1 diff)
-
src/Pugs/Prim.hs (modified) (2 diffs)
-
src/Pugs/Prim/Match.hs (modified) (2 diffs)
-
t/oo/class/basic.t (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/AST.hs
r2956 r2957 50 50 newScalar, newArray, newHandle, newObject, 51 51 proxyScalar, constScalar, lazyScalar, lazyUndef, constArray, 52 retError, retControl, retEmpty, retIVar, writeIVar,52 retError, retControl, retEmpty, retIVar, readIVar, writeIVar, 53 53 fromVals, refType, 54 54 mkPad, lookupPad, padToList, diffPads, unionPads, -
src/Pugs/AST/Internals.hs
r2956 r2957 1153 1153 1154 1154 data VObject = MkObject 1155 { objType :: VType1156 , objAttrs :: IHash1155 { objType :: !VType 1156 , objAttrs :: !IHash 1157 1157 } 1158 1158 deriving (Show, Eq, Ord, Typeable) -
src/Pugs/Prim.hs
r2956 r2957 60 60 op1 :: Ident -> Val -> Eval Val 61 61 op1 "!" = op1Cast (VBool . not) 62 op1 "clone" = \x -> do 63 (VObject o) <- fromVal x 64 attrs <- readIVar (IHash $ objAttrs o) 65 attrs' <- liftSTM $ newTVar Map.empty 66 writeIVar (IHash attrs') attrs 67 return $ VObject o{ objAttrs = attrs' } 62 68 op1 "chop" = \x -> do 63 69 ref <- fromVal x … … 1187 1193 \\n Int pre kill (Int, List)\ 1188 1194 \\n Object pre new (Type: Named)\ 1195 \\n Object pre clone (Object)\ 1189 1196 \\n List pre Pugs::Internals::runInteractiveCommand (?Str=$_)\ 1190 1197 \\n List pre Pugs::Internals::openFile (?Str,?Str=$_)\ -
src/Pugs/Prim/Match.hs
r2948 r2957 9 9 import Pugs.AST 10 10 import Pugs.Types 11 import Pugs.Context 11 12 import Pugs.Config 12 13 import qualified RRegex.PCRE as PCRE … … 67 68 y' <- readRef y 68 69 op2Match x y' 70 71 op2Match x (VType t) = do 72 typ <- evalValType x 73 cls <- asks envClasses 74 return $ VBool (isaType cls (showType t) typ) 69 75 70 76 op2Match x (VSubst (rx, subst)) | rxGlobal rx = do -
t/oo/class/basic.t
r2649 r2957 14 14 # L<S12/"Classes"> 15 15 16 eval 'class Foo {}';16 class Foo {}; 17 17 18 my $foo = eval 'Foo.new()';19 eval_ok('$foo ~~ Foo', '... smartmatch our $foo to the Foo class', :todo);18 my $foo = Foo.new(); 19 ok($foo ~~ Foo, '... smartmatch our $foo to the Foo class'); 20 20 21 my $foo_clone = eval '$foo.clone()';22 eval_ok('$foo_clone ~~ Foo', '... smartmatch our $foo_clone to the Foo class', :todo<feature>);21 my $foo_clone = $foo.clone(); 22 ok($foo_clone ~~ Foo, '... smartmatch our $foo_clone to the Foo class'); 23 23 24 24 # L<S12/"Classes" /An \"isa\" is just a trait that happens to be another class\:/>
