develooper Front page | perl.perl6.internals | Postings from July 2002

we need more ops.

Thread Next
From:
Sean O'Rourke
Date:
July 27, 2002 20:08
Subject:
we need more ops.
Message ID:
Pine.GSO.4.33.0207271954560.1422-200000@beowulf.ucsd.edu
Index: core.ops
===================================================================
RCS file: /cvs/public/parrot/core.ops,v
retrieving revision 1.187
diff -p -u -r1.187 core.ops
--- core.ops	26 Jul 2002 19:15:56 -0000	1.187
+++ core.ops	28 Jul 2002 02:53:25 -0000
@@ -1284,6 +1284,186 @@ op ge(in PMC, in PMC, inconst INT) {
 
 ########################################
 
+=item B<eq_num>(in PMC, in PMC, inconst INT)
+
+Branch if $1 is equal to $2 numerically-wise-speaking.
+
+=cut
+
+op eq_num(in PMC, in PMC, inconst INT) {
+  if ($1->vtable->cmp_num(interpreter, $1, $2) == 0) {
+    goto OFFSET($3);
+  }
+  goto NEXT();
+}
+
+########################################
+
+=item B<ne_num>(in PMC, in PMC, inconst INT)
+
+Branch if $1 is not the equal of $2 in a numeric light.
+
+=cut
+
+op ne_num(in PMC, in PMC, inconst INT) {
+  if ($1->vtable->cmp_num(interpreter, $1, $2) != 0) {
+    goto OFFSET($3);
+  }
+  goto NEXT();
+}
+
+########################################
+
+=item B<lt_num>(in PMC, in PMC, inconst INT)
+
+Branch if $1 is less than $2 numerically-wise-speaking.
+
+=cut
+
+op lt_num(in PMC, in PMC, inconst INT) {
+  if ($1->vtable->cmp_num(interpreter, $1, $2) < 0) {
+    goto OFFSET($3);
+  }
+  goto NEXT();
+}
+
+########################################
+
+=item B<le_num>(in PMC, in PMC, inconst INT)
+
+Branch if $1 is less than or equal to $2 numerically-wise-speaking.
+
+=cut
+
+op le_num(in PMC, in PMC, inconst INT) {
+  if ($1->vtable->cmp_num(interpreter, $1, $2) <= 0) {
+    goto OFFSET($3);
+  }
+  goto NEXT();
+}
+
+########################################
+
+=item B<gt_num>(in PMC, in PMC, inconst INT)
+
+Branch if $1 is greater than $2 numerically-wise-speaking.
+
+=cut
+
+op gt_num(in PMC, in PMC, inconst INT) {
+  if ($1->vtable->cmp_num(interpreter, $1, $2) > 0) {
+    goto OFFSET($3);
+  }
+  goto NEXT();
+}
+
+########################################
+
+=item B<ge_num>(in PMC, in PMC, inconst INT)
+
+Branch if $1 is greater than or equal to $2 numerically-wise-speaking.
+
+=cut
+
+op ge_num(in PMC, in PMC, inconst INT) {
+  if ($1->vtable->cmp_num(interpreter, $1, $2) >= 0) {
+    goto OFFSET($3);
+  }
+  goto NEXT();
+}
+
+########################################
+
+=item B<eq_string>(in PMC, in PMC, inconst INT)
+
+Branch if $1 is equal to $2 as a string.
+
+=cut
+
+op eq_num(in PMC, in PMC, inconst INT) {
+  if ($1->vtable->cmp_string(interpreter, $1, $2) == 0) {
+    goto OFFSET($3);
+  }
+  goto NEXT();
+}
+
+########################################
+
+=item B<ne_string>(in PMC, in PMC, inconst INT)
+
+Branch if $1 as a string is not $2 as a string.
+
+=cut
+
+op ne_string(in PMC, in PMC, inconst INT) {
+  if ($1->vtable->cmp_string(interpreter, $1, $2) != 0) {
+    goto OFFSET($3);
+  }
+  goto NEXT();
+}
+
+########################################
+
+=item B<lt_string>(in PMC, in PMC, inconst INT)
+
+Branch if $1 is less than $2 as a string.
+
+=cut
+
+op lt_string(in PMC, in PMC, inconst INT) {
+  if ($1->vtable->cmp_string(interpreter, $1, $2) < 0) {
+    goto OFFSET($3);
+  }
+  goto NEXT();
+}
+
+########################################
+
+=item B<le_string>(in PMC, in PMC, inconst INT)
+
+Branch if $1 is less than or equal to $2 as a string.
+
+=cut
+
+op le_string(in PMC, in PMC, inconst INT) {
+  if ($1->vtable->cmp_string(interpreter, $1, $2) <= 0) {
+    goto OFFSET($3);
+  }
+  goto NEXT();
+}
+
+########################################
+
+=item B<gt_string>(in PMC, in PMC, inconst INT)
+
+Branch if $1 is greater than $2 as a string.
+
+=cut
+
+op gt_string(in PMC, in PMC, inconst INT) {
+  if ($1->vtable->cmp_string(interpreter, $1, $2) > 0) {
+    goto OFFSET($3);
+  }
+  goto NEXT();
+}
+
+########################################
+
+=item B<ge_string>(in PMC, in PMC, inconst INT)
+
+Branch if $1 is greater than or equal to $2 as a string.
+
+=cut
+
+op ge_string(in PMC, in PMC, inconst INT) {
+  if ($1->vtable->cmp_string(interpreter, $1, $2) >= 0) {
+    goto OFFSET($3);
+  }
+  goto NEXT();
+}
+
+########################################
+
 =item B<if>(in INT, inconst INT)
 
 =item B<if>(in NUM, inconst INT)

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About