[svn:parrot] r40192 - in trunk: . src/pmc

bacek at svn.parrot.org bacek at svn.parrot.org
Tue Jul 21 12:56:53 UTC 2009


Author: bacek
Date: Tue Jul 21 12:56:53 2009
New Revision: 40192
URL: https://trac.parrot.org/parrot/changeset/40192

Log:
[cage] Remove Iterator.init

Modified:
   trunk/DEPRECATED.pod
   trunk/src/pmc/iterator.pmc

Modified: trunk/DEPRECATED.pod
==============================================================================
--- trunk/DEPRECATED.pod	Tue Jul 21 12:56:20 2009	(r40191)
+++ trunk/DEPRECATED.pod	Tue Jul 21 12:56:53 2009	(r40192)
@@ -79,21 +79,6 @@
 
 L<https://trac.parrot.org/parrot/ticket/264>
 
-=item Direct creation of Iterator [eligible in 1.5]
-
-Iterator PMC became pure interface class and direct creation of them is
-deprecated. Use C<iter> opcode instead.
-
-Code will become runtime error:
-
-  $P0 = new 'Iterator', aggr
-
-Proper invocation:
-
-  $P0 = iter arrg
-
-L<https://trac.parrot.org/parrot/ticket/811>
-
 =item VTABLE nomenclature. [eligible in 1.5]
 
 Current list of VTABLE functions will be reviewed and cleaned.

Modified: trunk/src/pmc/iterator.pmc
==============================================================================
--- trunk/src/pmc/iterator.pmc	Tue Jul 21 12:56:20 2009	(r40191)
+++ trunk/src/pmc/iterator.pmc	Tue Jul 21 12:56:53 2009	(r40192)
@@ -86,18 +86,8 @@
 */
 
     VTABLE void init_pmc(PMC *aggregate) {
-        if (VTABLE_does(INTERP, aggregate, CONST_STRING(INTERP, "array"))
-            || VTABLE_does(INTERP, aggregate, CONST_STRING(INTERP, "hash"))
-            || VTABLE_does(INTERP, aggregate, CONST_STRING(INTERP, "string"))) {
-            /* It's ugly hack... But I cant figure out proper way to do it. */
-            PMC * const real_iter = VTABLE_get_iter(INTERP, aggregate);
-            SELF = pmc_reuse_init(INTERP, SELF, VTABLE_type(INTERP, real_iter), aggregate, 0);
-            return;
-        }
-        else {
-            /* Die horribly */
-            PARROT_ASSERT(!"Unsupported Aggregate for Iterator");
-        }
+        Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
+                "Direct creation of Iterator");
     }
 
 


More information about the parrot-commits mailing list