diff --git a/eo-runtime/src/main/eo/org/eolang/negative-infinity.eo b/eo-runtime/src/main/eo/org/eolang/negative-infinity.eo index 2a28b8d992..3a9e5763ee 100644 --- a/eo-runtime/src/main/eo/org/eolang/negative-infinity.eo +++ b/eo-runtime/src/main/eo/org/eolang/negative-infinity.eo @@ -78,17 +78,19 @@ [num] > is-nan-or-zero or. > @ - is-nan num - num.eq -0.0 - num.eq 0.0 + or. + or. + is-nan num + num.eq -0.0 + num.eq 0.0 num.eq 0 if. > @ is-nan-or-zero value nan - if. - is-num-gt-zero value - negative-infinity - positive-infinity + if. + is-num-gt-zero value + negative-infinity + positive-infinity # Sum of $ and x [x] > plus @@ -116,12 +118,11 @@ not. > @ num.eq num if. > @ - if. - or. - is-nan value - value.as-bytes.eq neg-inf-as-bytes - nan - negative-infinity + or. + is-nan value + value.as-bytes.eq neg-inf-as-bytes + nan + negative-infinity # Quotient of the division of $ by x [x] > div @@ -133,8 +134,9 @@ [num] > is-nan-or-infinite or. > @ - is-nan num - num.eq positive-infinity + or. + is-nan num + num.eq positive-infinity num.eq negative-infinity [num] > is-num-gte-zero diff --git a/eo-runtime/src/main/eo/org/eolang/positive-infinity.eo b/eo-runtime/src/main/eo/org/eolang/positive-infinity.eo index 87ca7c0eae..64dfc8ea19 100644 --- a/eo-runtime/src/main/eo/org/eolang/positive-infinity.eo +++ b/eo-runtime/src/main/eo/org/eolang/positive-infinity.eo @@ -70,9 +70,11 @@ [num] > is-nan-or-zero or. > @ - is-nan num - num.eq -0.0 - num.eq 0.0 + or. + or. + is-nan num + num.eq -0.0 + num.eq 0.0 num.eq 0 [num] > is-num-gt-zero @@ -132,8 +134,9 @@ [num] > is-nan-or-infinite or. > @ - is-nan num - num.eq positive-infinity + or. + is-nan num + num.eq positive-infinity num.eq negative-infinity [num] > is-num-gte-zero diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EOfloat$EOplus.java b/eo-runtime/src/main/java/EOorg/EOeolang/EOfloat$EOplus.java index 31a1d01259..24466a37bc 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EOfloat$EOplus.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EOfloat$EOplus.java @@ -58,8 +58,10 @@ public class EOfloat$EOplus extends PhDefault { new AtComposite( this, rho -> new Data.ToPhi( - new Param(rho).strong(Double.class) - + new Param(rho, "x").strong(Double.class) + Double.sum( + new Param(rho).strong(Double.class), + new Param(rho, "x").strong(Double.class) + ) ) ) ); diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EOint$EOplus.java b/eo-runtime/src/main/java/EOorg/EOeolang/EOint$EOplus.java index 3d52b9a944..ffc74114fd 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EOint$EOplus.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EOint$EOplus.java @@ -58,8 +58,10 @@ public class EOint$EOplus extends PhDefault { new AtComposite( this, rho -> new Data.ToPhi( - new Param(rho).strong(Long.class) - + new Param(rho, "x").strong(Long.class) + Long.sum( + new Param(rho).strong(Long.class), + new Param(rho, "x").strong(Long.class) + ) ) ) ); diff --git a/eo-runtime/src/test/eo/org/eolang/bool-tests.eo b/eo-runtime/src/test/eo/org/eolang/bool-tests.eo index 9a673f6347..dcf1f87849 100644 --- a/eo-runtime/src/test/eo/org/eolang/bool-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/bool-tests.eo @@ -37,14 +37,6 @@ TRUE 42 -[] > joins-many-ands - and. > @ - TRUE - 5.lt 10 - 4.gt -6 - TRUE - 0.eq 0 - [] > forks-on-condition eq. > @ if. @@ -67,45 +59,6 @@ x.as-int.plus 1 11 -# tests that bool.and stops calculations if its i'th -# object is false (including the base object) -[] > and-short-circuiting - memory 0 > mFirst - memory 0 > mThird - and. > res - not. - and. - (mFirst.write 1).eq 100 - (mFirst.write 2).eq 2 - (mFirst.write 3).eq 3 - not. - and. - (mThird.write 1).eq 1 - (mThird.write 2).eq 2 - (mThird.write 3).eq 300 - (mThird.write 4).eq 4 - mFirst.eq 1 - mThird.eq 3 - nop > @ - -# tests that bool.or stops calculations if its i'th -# object is true (including the base object) -[] > or-short-circuiting - memory 0 > mFirst - memory 0 > mThird - and. > @ - or. - (mFirst.write 1).eq 1 - mFirst.write 2 - mFirst.write 3 - or. - (mThird.write 1).eq 100 - (mThird.write 2).eq 200 - (mThird.write 3).eq 3 - mThird.write 4 - mFirst.eq 1 - mThird.eq 3 - [] > compares-bool-to-bytes and. > @ TRUE.eq 01- diff --git a/eo-runtime/src/test/eo/org/eolang/bytes-tests.eo b/eo-runtime/src/test/eo/org/eolang/bytes-tests.eo index 926bfaa328..4b87e289a6 100644 --- a/eo-runtime/src/test/eo/org/eolang/bytes-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/bytes-tests.eo @@ -162,15 +162,6 @@ -7.as-bytes.and (7.as-bytes) -2.as-bytes -[] > and-with-vararg - eq. > @ - as-int. - and. - 0.as-bytes - 5.as-bytes - 10.as-bytes - 0 - [] > or-with-zero not. > @ eq. @@ -195,16 +186,6 @@ -7.as-bytes.or (23.as-bytes) 0.as-bytes -[] > or-with-vararg - not. > @ - eq. - as-int. - or. - 256.as-bytes - 5.as-bytes - 10.as-bytes - -1 - [] > xor-with-zero not. > @ eq. @@ -229,16 +210,6 @@ -36.as-bytes.xor (43.as-bytes) 8.as-bytes -[] > xor-with-vararg - not. > @ - eq. - as-int. - xor. - 256.as-bytes - 5.as-bytes - 10.as-bytes - -1 - [] > not-with-zero not. > @ eq. diff --git a/eo-runtime/src/test/eo/org/eolang/float-tests.eo b/eo-runtime/src/test/eo/org/eolang/float-tests.eo index 26905fde41..34109531c8 100644 --- a/eo-runtime/src/test/eo/org/eolang/float-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/float-tests.eo @@ -232,15 +232,6 @@ 0.311985 -0.1792353825 -[] > times-multiple - eq. > @ - times. - -0.5745 - 0.311985 - 3.232 - -2.532 - 1.4667591307996803 - [] > add-test eq. > @ plus. @@ -248,28 +239,18 @@ 311.985 886.485 -[] > add-multiple-test - eq. > @ - plus. - 574.5 - 311.985 - -101.1 - 1.001 - 786.386 - [] > add-wrong-args - eq. > @ - try - [] - plus. > @ - 574.5 - 311 - -101.1 - 1.001 - [e] - e > @ - nop - "The 1th argument of 'float.plus' is not a(n) Double: 311" + not. > @ + eq. + try + [] + plus. > @ + 42.5 + 24 + [e] + e > @ + nop + 66.5 [] > neg-test eq. > @ @@ -283,15 +264,6 @@ 311.985 262.515 -[] > sub-multiple-test - eq. > @ - minus. - 574.5 - 311.985 - -24.347 - 3542.2238 - -3255.3618 - [] > div-test eq. > @ div. @@ -299,14 +271,6 @@ 0.5 31.0 -[] > div-multiple - eq. > @ - div. - 15.5 - 0.5 - 0.2 - 155.0 - [] > zero-div-zero-as-bytes-is-equal-to-nan-as-bytes eq. > @ (0.0.div 0.0).as-bytes diff --git a/eo-runtime/src/test/eo/org/eolang/heap-tests.eo b/eo-runtime/src/test/eo/org/eolang/heap-tests.eo index d3f9bbea78..bcd17e6195 100644 --- a/eo-runtime/src/test/eo/org/eolang/heap-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/heap-tests.eo @@ -89,12 +89,13 @@ p2.sub 1 > p3 eq. > @ and. - (p1.block 6).write ("HELLO!".as-bytes) - eq. - p2.block - 2 - [b] (b.as-string > @) - "O!" + and. + (p1.block 6).write ("HELLO!".as-bytes) + eq. + p2.block + 2 + [b] (b.as-string > @) + "O!" eq. p3.block 2 diff --git a/eo-runtime/src/test/eo/org/eolang/int-tests.eo b/eo-runtime/src/test/eo/org/eolang/int-tests.eo index 9bb898693f..df90b096e7 100644 --- a/eo-runtime/src/test/eo/org/eolang/int-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/int-tests.eo @@ -131,11 +131,15 @@ [] > int-equal-to-nan-and-infinites-is-false eq. > @ and. - (0.eq nan).eq FALSE - (0.eq positive-infinity).eq FALSE - (0.eq negative-infinity).eq FALSE - (42.eq nan).eq FALSE - (42.eq positive-infinity).eq FALSE + and. + and. + and. + and. + (0.eq nan).eq FALSE + (0.eq positive-infinity).eq FALSE + (0.eq negative-infinity).eq FALSE + (42.eq nan).eq FALSE + (42.eq positive-infinity).eq FALSE (42.eq negative-infinity).eq FALSE TRUE @@ -220,7 +224,7 @@ [e] e > @ nop - "Can't divide by " + "Can't divide by integer zero" # Checks that division by one returns the dividend [] > division-by-one @@ -246,21 +250,6 @@ 1.div 5 0 -[] > div-with-multiple - eq. > @ - 100.div 5 2 -5 - -2 - -[] > div-wrong-args - eq. > @ - try - [] - 100.div 1 2 3.0 > @ - [e] - e > @ - nop - "The 3th argument of 'int.div' is not a(n) Long: 3.0" - [] > to-bytes-and-backwards eq. > @ as-int. @@ -278,42 +267,7 @@ 42.as-bytes 42 -[] > sum-up-several-arguments - eq. > @ - 1982 - 1000.plus 900 80 2 - -[] > sum-up-wrong-args - eq. > @ - try - [] - 100.plus 1 2 3.0 > @ - [e] - e > @ - nop - "The 3th argument of 'int.plus' is not a(n) Long: 3.0" - -[] > multiply-several-arguments - eq. > @ - 1000.times 2 5 - 10000 - -[] > multiply-wrong-args - eq. > @ - try - [] - 100.times 1 2 3.0 > @ - [e] - e > @ - nop - "The 3th argument of 'int.times' is not a(n) Long: 3.0" - [] > multiply-by-zero eq. > @ 1000.times 0 0 - -[] > minus-multiple-args - eq. > @ - 123.minus -12 135 235 0 - -235 diff --git a/eo-runtime/src/test/eo/org/eolang/positive-infinity-tests.eo b/eo-runtime/src/test/eo/org/eolang/positive-infinity-tests.eo index 5a7c37ab2a..b02ba03b61 100644 --- a/eo-runtime/src/test/eo/org/eolang/positive-infinity-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/positive-infinity-tests.eo @@ -177,17 +177,27 @@ negative-infinity > neg-inf eq. > @ and. - (0.0.eq nan).eq FALSE - (0.0.eq pos-inf).eq FALSE - (0.0.eq neg-inf).eq FALSE - (42.5.eq nan).eq FALSE - (42.5.eq pos-inf).eq FALSE - (42.5.eq neg-inf).eq FALSE - (0.0.eq nan).eq FALSE - (0.0.eq pos-inf).eq FALSE - (0.0.eq neg-inf).eq FALSE - (42.5.eq nan).eq FALSE - (42.5.eq pos-inf).eq FALSE + and. + and. + and. + and. + and. + and. + and. + and. + and. + and. + (0.0.eq nan).eq FALSE + (0.0.eq pos-inf).eq FALSE + (0.0.eq neg-inf).eq FALSE + (42.5.eq nan).eq FALSE + (42.5.eq pos-inf).eq FALSE + (42.5.eq neg-inf).eq FALSE + (0.0.eq nan).eq FALSE + (0.0.eq pos-inf).eq FALSE + (0.0.eq neg-inf).eq FALSE + (42.5.eq nan).eq FALSE + (42.5.eq pos-inf).eq FALSE (42.5.eq neg-inf).eq FALSE TRUE diff --git a/eo-runtime/src/test/eo/org/eolang/runtime-tests.eo b/eo-runtime/src/test/eo/org/eolang/runtime-tests.eo index 4dee9c952a..f0885ab4d4 100644 --- a/eo-runtime/src/test/eo/org/eolang/runtime-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/runtime-tests.eo @@ -129,8 +129,9 @@ [] > positive-object-vertices eq. > @ or. - 42.<.eq (42.<) - "Hello".<.eq ("Hello".<) + or. + 42.<.eq (42.<) + "Hello".<.eq ("Hello".<) 45-1F-E7.<.eq (45-1F-E7.<) FALSE @@ -145,10 +146,13 @@ [x] > a eq. > @ or. - (2.plus 3).<.eq (5.<) - 42.<.eq (42.0.<) - 45-1F-E8.<.eq (45-1F-E8-83.<) - (a 5).<.eq ((a 5).<) + or. + or. + or. + (2.plus 3).<.eq (5.<) + 42.<.eq (42.0.<) + 45-1F-E8.<.eq (45-1F-E8-83.<) + (a 5).<.eq ((a 5).<) (* 1 2 3).<.eq ((* 1 2 3).<) FALSE diff --git a/eo-runtime/src/test/eo/org/eolang/tuple-tests.eo b/eo-runtime/src/test/eo/org/eolang/tuple-tests.eo index d5352611c5..6aeb5520ce 100644 --- a/eo-runtime/src/test/eo/org/eolang/tuple-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/tuple-tests.eo @@ -90,15 +90,17 @@ * 1 2 3 "with" and. > @ - eq. - arr.at 0 - 1 - eq. - arr.at 1 - 2 - eq. - arr.at 2 - 3 + and. + and. + eq. + arr.at 0 + 1 + eq. + arr.at 1 + 2 + eq. + arr.at 2 + 3 eq. arr.at 3 "with" @@ -118,12 +120,13 @@ [] > tuple-fluent-with ((*.with 1).with 2).with 3 > arr and. > @ - eq. - arr.at 0 - 1 - eq. - arr.at 1 - 2 + and. + eq. + arr.at 0 + 1 + eq. + arr.at 1 + 2 eq. arr.at 2 3 @@ -134,12 +137,13 @@ .with 2 .with 3 > arr and. > @ - eq. - arr.at 0 - 1 - eq. - arr.at 1 - 2 + and. + eq. + arr.at 0 + 1 + eq. + arr.at 1 + 2 eq. arr.at 2 3 @@ -167,12 +171,13 @@ .with 2 .with 3 > arr and. > @ - eq. - arr.at 0 - 1 - eq. - arr.at 1 - 2 + and. + eq. + arr.at 0 + 1 + eq. + arr.at 1 + 2 eq. arr.at 2 3