Skip to content

Commit

Permalink
fix(#3152): reduced amount of comments in runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
maxonfjvipon committed Apr 27, 2024
1 parent 6154f23 commit c0baf94
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 35 deletions.
2 changes: 0 additions & 2 deletions eo-runtime/src/main/eo/org/eolang/cage.eo
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
# Object encaged by locator.
[locator] > encaged
$ > self

# Retrieved encaged object by locator.
[] > @ /?

# Encage new object by locator.
Expand Down
1 change: 1 addition & 0 deletions eo-runtime/src/main/eo/org/eolang/dataized.eo
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
# attribute.
# An example of usage:
# ```
# # Some 64+ characters comment should be here.
# [] > foo
# [] > @
# ^.inner.five > @
Expand Down
3 changes: 0 additions & 3 deletions eo-runtime/src/main/eo/org/eolang/go.eo
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
8
m.put m.id > [m]

# To.
[body] > to
try > @
body token
Expand All @@ -69,15 +68,13 @@
error e
true

# Token.
[] > token
# Backward jump.
error > backward
[]
&.^.^.to &.^.body > value
&.^.^.id > id

# Forward jump.
[res] > forward
error > @
[]
Expand Down
2 changes: 0 additions & 2 deletions eo-runtime/src/main/eo/org/eolang/malloc.eo
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@
# Allocates block in memory of given `size`. After allocation the `size` zero bytes bytes are
# written into memory.
[size scope] > of
# Allocates a memory block, initializes it, pass it to the `scope` and dataizes `scope` and
# at the end, even if the error is occurred, clears the block.
[] > @ /bytes

# Allocated block in memory that provides an API for writing and reading.
Expand Down
15 changes: 3 additions & 12 deletions eo-runtime/src/main/eo/org/eolang/negative-infinity.eo
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,16 @@
[x] > times
x > value!

# Tests if given number is greater than float or integer zero.
[num] > is-num-gt-zero
try > @
[]
0.lt num > @
0.lt num
[e]
0.0.lt num > @
false

# Here we check if 'num' is nan by comparing it with nan bytes, because 'num' is cached bytes.
[num] > is-nan
num.eq nan.as-bytes > @

# Tests if given number is equal to nan, float or integer zero.
[num] > is-nan-or-zero
or. > @
or.
Expand All @@ -98,7 +94,6 @@
positive-infinity.as-bytes > pos-inf-as-bytes!
x > value!

# Here we check if 'num' is nan by comparing it with nan bytes, because 'num' is cached bytes.
[num] > is-nan
num.eq nan.as-bytes > @
if. > @
Expand All @@ -113,7 +108,6 @@
x > value!
negative-infinity > neg-inf-as-bytes!

# Here we check if 'num' is nan by comparing it with nan bytes, because 'num' is cached bytes.
[num] > is-nan
num.eq nan.as-bytes > @
if. > @
Expand All @@ -126,23 +120,20 @@
# Quotient of the division of $ by x
[x] > div
x > value!
# Here we check if 'num' is nan by comparing it with nan bytes, because 'num' is cached bytes.

[num] > is-nan
num.eq nan.as-bytes > @

# Tests if given number is equal to nan, positive or negative infinity.
[num] > is-nan-or-infinite
or. > @
or.
is-nan num
num.eq positive-infinity
num.eq negative-infinity

# Tests if given number is greater or equal to float or integer zero.
[num] > is-num-gte-zero
try > @
[]
0.lte num > @
0.lte num
[e]
0.0.lte num > @
false
Expand Down
14 changes: 2 additions & 12 deletions eo-runtime/src/main/eo/org/eolang/positive-infinity.eo
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,9 @@
[x] > times
x > value!

# Here we check if 'num' is nan by comparing it with nan bytes, because 'num' is cached bytes.
[num] > is-nan
num.eq nan.as-bytes > @

# Tests if given number is equal to nan, float or integer zero.
[num] > is-nan-or-zero
or. > @
or.
Expand All @@ -77,11 +75,9 @@
num.eq 0.0
num.eq 0

# Tests if given number is greater than float or integer zero.
[num] > is-num-gt-zero
try > @
[]
0.lt num > @
0.lt num
[e]
0.0.lt num > @
false
Expand All @@ -98,7 +94,6 @@
x > value!
negative-infinity > neg-inf-as-bytes!

# Here we check if 'num' is nan by comparing it with nan bytes, because 'num' is cached bytes.
[num] > is-nan
num.eq nan.as-bytes > @
if. > @
Expand All @@ -113,7 +108,6 @@
x > value!
positive-infinity > pos-inf-as-bytes!

# Here we check if 'num' is nan by comparing it with nan bytes, because 'num' is cached bytes.
[num] > is-nan
num.eq nan.as-bytes > @
if. > @
Expand All @@ -127,23 +121,19 @@
[x] > div
x > value!

# Here we check if 'num' is nan by comparing it with nan bytes, because 'num' is cached bytes.
[num] > is-nan
num.eq nan.as-bytes > @

# Tests if given number is equal to nan, positive or negative infinity.
[num] > is-nan-or-infinite
or. > @
or.
is-nan num
num.eq positive-infinity
num.eq negative-infinity

# Tests if given number is greater or equal to float or integer zero.
[num] > is-num-gte-zero
try > @
[]
0.lte num > @
0.lte num
[e]
0.0.lte num > @
false
Expand Down
7 changes: 3 additions & 4 deletions eo-runtime/src/main/eo/org/eolang/tuple.eo
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
[head tail] > tuple
# Empty tuple.
[] > empty
# Take one element from the tuple, at the given position.
0 > length

[i] > at
error "Can't get an object from the empty tuple" > @
# Take one element from the tuple, at the given position.

[x] > with
tuple > @
tuple.empty
x
0 > length

# Obtain the length of the tuple.
[] > length
Expand All @@ -60,7 +60,6 @@
error "Given index is out of tuple bounds"
at-fast ^ len

# Fast recursive obtaining element from tuple.
[tup len] > at-fast
if. > @
(len.plus -1).gt ^.index
Expand Down

0 comments on commit c0baf94

Please sign in to comment.