Signed-off-by: Jean Privat <jean@pryen.org>
# This file is part of NIT ( http://www.nitlanguage.org ).
#
# This file is part of NIT ( http://www.nitlanguage.org ).
#
-# Copyright 2004-2008 Jean Privat <jean@pryen.org>
-#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# See the License for the specific language governing permissions and
# limitations under the License.
# See the License for the specific language governing permissions and
# limitations under the License.
+ fun +: A
+ do
+ 0.output
+ return self
+ end
fun +(a: A): A
do
2.output
fun +(a: A): A
do
2.output
+ fun **(a: A): A
+ do
+ 16.output
+ return a
+ end
+ fun |(a: A): A
+ do
+ 16.output
+ return a
+ end
+ fun ^(a: A): A
+ do
+ 17.output
+ return a
+ end
+ fun &(a: A): A
+ do
+ 18.output
+ return a
+ end
+ fun ~: A
+ do
+ 19.output
+ return self
+ end
var a2 = new A
var b : Bool
var i: Int
var a2 = new A
var b : Bool
var i: Int
-a = a + -a - a * a / a % a >> a << a
+
+a = +a + -a - a * a / a % a >> a << a ** a | ~a ^ a & a
b = a == a2 and a < a and a > a and a <= a and a >= a
i = a <=> a
b = a == a2 and a < a and a > a and a <= a and a >= a
i = a <=> a
+
+'\n'.output
+
+a += a
+a -= a
+a *= a
+a /= a
+a %= a
+a **= a
+a <<= a
+a >>= a
+a |= a
+a ^= a
+a &= a
--- /dev/null
+0
+1
+2
+3
+4
+5
+6
+15
+16
+14
+19
+18
+17
+16
+7
+9
+10
+11
+12
+13
+
+2
+6
+3
+4
+5
+16
+14
+15
+16
+17
+18
+++ /dev/null
-1
-2
-3
-4
-5
-6
-15
-14
-7
-9
-10
-11
-12
-13