Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add some more operators to the NQP setting.

  • Loading branch information...
commit d3865c1ba74487c9455aadc678f5db51cbddfacc 1 parent 8fcea1c
Jonathan Worthington authored August 18, 2010

Showing 1 changed file with 24 additions and 0 deletions. Show diff stats Hide diff stats

  1. 24  common/NQP/NQPSetting.pm
24  common/NQP/NQPSetting.pm
@@ -71,3 +71,27 @@ sub &prefix:<!>($x) {
71 71
 sub &prefix:<?>($x) {
72 72
     $x.Bool
73 73
 }
  74
+
  75
+sub &infix:<+>($x, $y) {
  76
+    nqp::add_int($x.Int, $y.Int, NQPInt);
  77
+}
  78
+
  79
+sub &infix:<->($x, $y) {
  80
+    nqp::sub_int($x.Int, $y.Int, NQPInt);
  81
+}
  82
+
  83
+sub &infix:<*>($x, $y) {
  84
+    nqp::mul_int($x.Int, $y.Int, NQPInt);
  85
+}
  86
+
  87
+sub &infix:</>($x, $y) {
  88
+    nqp::div_int($x.Int, $y.Int, NQPInt);
  89
+}
  90
+
  91
+sub &infix:<%>($x, $y) {
  92
+    nqp::mod_int($x.Int, $y.Int, NQPInt);
  93
+}
  94
+
  95
+sub &infix:<~>($x, $y) {
  96
+    nqp::concat($x.Str, $y.Str, NQPStr);
  97
+}

0 notes on commit d3865c1

Please sign in to comment.
Something went wrong with that request. Please try again.