Skip to content

Commit

Permalink
feat(objectionary#2555): merge runtime without varargs
Browse files Browse the repository at this point in the history
  • Loading branch information
maxonfjvipon committed Oct 27, 2023
2 parents f855f29 + d3f2096 commit 8e1cd27
Show file tree
Hide file tree
Showing 31 changed files with 281 additions and 1,335 deletions.
2 changes: 1 addition & 1 deletion eo-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ SOFTWARE.
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.14.0</version>
<version>2.15.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
18 changes: 16 additions & 2 deletions eo-runtime/src/main/eo/org/eolang/bool.eo
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,24 @@
FALSE

# AND
[x...] > and /bool
[x] > and
if. > @
^
if.
x
TRUE
FALSE
FALSE

# OR
[x...] > or /bool
[x] > or
if. > @
^
TRUE
if.
x
TRUE
FALSE

# While this is true copies the object
# with "i" as the position of the cycle. The result
Expand Down
6 changes: 3 additions & 3 deletions eo-runtime/src/main/eo/org/eolang/bytes.eo
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@
[] > as-float /float

# Calculate bitwise and
[b...] > and /bytes
[b] > and /bytes

# Calculate bitwise or
[b...] > or /bytes
[b] > or /bytes

# Calculate bitwise xor
[b...] > xor /bytes
[b] > xor /bytes

# Calculate bitwise not
[] > not /bytes
Expand Down
24 changes: 5 additions & 19 deletions eo-runtime/src/main/eo/org/eolang/float.eo
Original file line number Diff line number Diff line change
Expand Up @@ -72,35 +72,21 @@
^.gt value

# Multiplication of $ and x
[x...] > times /float
[x] > times /float

# Sum of $ and x
[x...] > plus /float
[x] > plus /float

# Negation of $
[] > neg
^.times -1.0 > @

# Difference between $ and x
[x...] > minus
[acc index terms] > rec-terms
if. > @
index.eq terms.length
acc
rec-terms
acc.with
(terms.at index).neg
index.plus 1
terms
rec-terms > neg-terms
*
0
x
^.plus > @
...neg-terms
[x] > minus
^.plus x.neg > @

# Quotient of the division of $ by x
[x...] > div /float
[x] > div /float

# Converts this to bytes
[] > as-bytes /bytes
24 changes: 5 additions & 19 deletions eo-runtime/src/main/eo/org/eolang/int.eo
Original file line number Diff line number Diff line change
Expand Up @@ -71,31 +71,17 @@
^.times -1 > @

# Add to the current one
[x...] > plus /int
[x] > plus /int

# Subtract from the current one
[x...] > minus
[acc index terms] > rec-terms
if. > @
index.eq terms.length
acc
rec-terms
acc.with
(terms.at index).neg
index.plus 1
terms
rec-terms > neg-terms
*
0
x
^.plus > @
...neg-terms
[x] > minus
^.plus x.neg > @

# Multiplication this one by another int
[x...] > times /int
[x] > times /int

# Divide this one by another int
[x...] > div /int
[x] > div /int

# Converts this to bytes
[] > as-bytes /bytes
8 changes: 4 additions & 4 deletions eo-runtime/src/main/eo/org/eolang/nan.eo
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,21 @@
FALSE > @

# Multiplication of $ and x
[x...] > times
[x] > times
^ > @

# Sum of $ and x
[x...] > plus
[x] > plus
^ > @

# Negation of $
[] > neg
^ > @

# Difference between $ and x
[x...] > minus
[x] > minus
^ > @

# Quotient of the division of $ by x
[x...] > div
[x] > div
^ > @
Loading

0 comments on commit 8e1cd27

Please sign in to comment.