[svn:parrot] r38594 - branches/tt631_part3/src/pmc

bacek at svn.parrot.org bacek at svn.parrot.org
Fri May 8 10:41:00 UTC 2009


Author: bacek
Date: Fri May  8 10:41:00 2009
New Revision: 38594
URL: https://trac.parrot.org/parrot/changeset/38594

Log:
Add stub for read-only methods in default.pmc

Modified:
   branches/tt631_part3/src/pmc/default.pmc

Modified: branches/tt631_part3/src/pmc/default.pmc
==============================================================================
--- branches/tt631_part3/src/pmc/default.pmc	Fri May  8 10:40:43 2009	(r38593)
+++ branches/tt631_part3/src/pmc/default.pmc	Fri May  8 10:41:00 2009	(r38594)
@@ -68,6 +68,28 @@
             caller(interp, pmc));
 }
 
+
+/*
+
+=item C<static void cant_do_write_method(PARROT_INTERP, PMC *pmc,
+                                   const char *methname)>
+
+Throws an exception "$methname() on read-only instance of '$class'", used by
+all updating messages on read-only instances.
+
+=cut
+
+*/
+
+PARROT_DOES_NOT_RETURN
+static void
+cant_do_write_method(PARROT_INTERP, PMC *pmc /*NULLOK*/, const char *methname)
+{
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_WRITE_TO_CONSTCLASS,
+            "%s() in read-only instance of '%Ss'", methname,
+            caller(interp, pmc));
+}
+
 /*
 
 =item C<static INTVAL


More information about the parrot-commits mailing list