Accompanying patch adds the "fortytwo" op to Parrot, so the following
PASM becomes legal:

        fortytwo I0
        print I0
        print "\n"
        end

Example:

$ ../parrot test42.pasm 
42

Sorry, could not resist. :-)

++Jos.es

-- 
ek is so lug jy vlieg deur my
sonder jou is ek sonder patroon
   "Breyten Breytenbach"
Index: set.ops
===================================================================
RCS file: /cvs/public/parrot/set.ops,v
retrieving revision 1.1
diff -u -b -B -r1.1 set.ops
--- set.ops     22 Jul 2003 16:11:49 -0000      1.1
+++ set.ops     7 Aug 2003 15:18:43 -0000
@@ -516,6 +516,40 @@
 
 =cut
 
+########################################
+
+=item B<fortytwo>(out STR)
+
+=item B<fortytwo>(out INT)
+
+=item B<fortytwo>(out PMC)
+
+=item B<fortytwo>(out NUM)
+
+Set register $1 to the value 42.
+
+=cut
+
+inline op fortytwo(out STR) {
+  $1 = string_from_num(interpreter, 42);
+  goto NEXT();
+}
+
+inline op fortytwo(out INT) {
+  $1 = 42;
+  goto NEXT();
+}
+
+inline op fortytwo(out PMC) {
+  $1->vtable->set_integer_native(interpreter, $1, 42);
+  goto NEXT();
+}
+
+inline op fortytwo(out NUM) {
+  $1 = 42;
+  goto NEXT();
+}
+
 ###############################################################################
 
 =head1 COPYRIGHT

Reply via email to