[svn:parrot] r39923 - branches/ops_pct/compilers/opsc

bacek at svn.parrot.org bacek at svn.parrot.org
Tue Jul 7 12:04:50 UTC 2009


Author: bacek
Date: Tue Jul  7 12:04:43 2009
New Revision: 39923
URL: https://trac.parrot.org/parrot/changeset/39923

Log:
Steal builtins.pir from pmc_pct

Modified:
   branches/ops_pct/compilers/opsc/builtins.pir

Modified: branches/ops_pct/compilers/opsc/builtins.pir
==============================================================================
--- branches/ops_pct/compilers/opsc/builtins.pir	Tue Jul  7 11:31:10 2009	(r39922)
+++ branches/ops_pct/compilers/opsc/builtins.pir	Tue Jul  7 12:04:43 2009	(r39923)
@@ -0,0 +1,58 @@
+# $Id$
+# Copyright (C) 2009, Parrot Foundation.
+
+=head1 Builtins
+
+Variour helper builtins.
+
+=cut
+.namespace []
+
+.sub 'uc'
+    .param string arg
+    $S0 = upcase arg
+    .return ($S0)
+.end
+
+.sub 'join'
+    .param string joiner
+    .param pmc args
+
+    unless args goto done
+    $S0 = join joiner, args
+  done:
+    .return ($S0)
+.end
+
+.sub 'defined'
+    .param pmc thing
+    $I0 = defined thing
+    .return ($I0)
+.end
+
+.sub 'exists'
+    .param pmc where
+    .param pmc what
+    $I0 = exists where[what]
+    .return ($I0)
+.end
+
+.sub 'clone'
+    .param pmc what
+    $P0 = clone what
+    .return ($P0)
+.end
+
+.sub 'substr'
+    .param string orig
+    .param int    from
+    .param int    len
+    $S0 = substr orig, from, len
+    .return ($S0)
+.end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:


More information about the parrot-commits mailing list