# New Ticket Created by  "Sean O'Rourke" 
# Please include the string:  [netlabs #792]
# in the subject line of all future correspondence about this issue. 
# <URL: http://bugs6.perl.org/rt2/Ticket/Display.html?id=792 >


This patch does the following:

- add defined() to PerlUndef
- add neg(PMC) to PerlNum
- fix logical_not(PMC) in PerlInt -- it was backwards.

/s


-- attachment  1 ------------------------------------------------------
url: http://bugs6.perl.org/rt2/attach/3733/3474/6f0d76/perlpmc.patch

Index: perlint.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/perlint.pmc,v
retrieving revision 1.24
diff -w -p -u -r1.24 perlint.pmc
--- perlint.pmc 12 Jun 2002 22:12:18 -0000      1.24
+++ perlint.pmc 11 Jul 2002 03:51:50 -0000
@@ -590,7 +590,7 @@ fprintf(stderr,"perlint_modulus not impl
     }
 
     void logical_not (PMC* value) {
-        SELF->cache.int_val = (INTVAL)(!value->vtable->get_bool(INTERP, value));
+           value->vtable->set_integer_native(INTERP, value, !SELF->cache.int_val);
     }
 
     void repeat (PMC* value, PMC* dest) {
@@ -606,4 +606,5 @@ fprintf(stderr,"perlint_modulus not impl
     void decrement () {
         SELF->cache.int_val --;
     }
+
 }
Index: perlnum.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/perlnum.pmc,v
retrieving revision 1.25
diff -w -p -u -r1.25 perlnum.pmc
--- perlnum.pmc 12 Jun 2002 22:12:18 -0000      1.25
+++ perlnum.pmc 11 Jul 2002 03:51:50 -0000
@@ -318,6 +318,10 @@ fprintf(stderr,"modulus_float not implem
 fprintf(stderr,"modulus_same not implemented\n");
     }
 
+    void neg (PMC * dest) {
+       dest->vtable->set_number_native(INTERP, dest, -SELF->cache.num_val);
+    }
+
     void bitwise_or (PMC* value, PMC* dest) {
         dest->vtable->set_integer_native(INTERP, dest,
             (INTVAL)SELF->cache.num_val |
@@ -462,4 +466,5 @@ fprintf(stderr,"repeat_int not implement
     void decrement () {
         SELF->cache.num_val --;
     }
+
 }
Index: perlundef.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/perlundef.pmc,v
retrieving revision 1.16
diff -w -p -u -r1.16 perlundef.pmc
--- perlundef.pmc       21 Jun 2002 17:22:34 -0000      1.16
+++ perlundef.pmc       11 Jul 2002 03:51:51 -0000
@@ -447,4 +447,8 @@ pmclass PerlUndef {
         Parrot_warn(INTERP, PARROT_WARNINGS_UNDEF_FLAG, "Use of uninitialized value 
in repeat");
         dest->vtable->set_string(INTERP, dest, NULL);
     }
+
+    INTVAL defined () {
+       return 0;
+    }
 }

Reply via email to