Skip to content

Commit

Permalink
feat(#2437): as-bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
maxonfjvipon committed Nov 14, 2023
1 parent 3460e56 commit 195be9e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 19 deletions.
5 changes: 2 additions & 3 deletions eo-runtime/src/main/eo/org/eolang/bool.eo
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@
+rt jvm org.eolang:eo-runtime:0.0.0
+version 0.0.0

[data] > bool
data > @
data > as-bytes
[as-bytes] > bool
as-bytes > @

# Equal to another object?
[x] > eq
Expand Down
5 changes: 2 additions & 3 deletions eo-runtime/src/main/eo/org/eolang/float.eo
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@
+rt jvm org.eolang:eo-runtime:0.0.0
+version 0.0.0

[data] > float
data > @
data > as-bytes
[as-bytes] > float
as-bytes > @

# Tests that $ = x
[x] > eq
Expand Down
5 changes: 2 additions & 3 deletions eo-runtime/src/main/eo/org/eolang/int.eo
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@
+rt jvm org.eolang:eo-runtime:0.0.0
+version 0.0.0

[data] > int
data > @
data > as-bytes
[as-bytes] > int
as-bytes > @

# Tests that $ = x
[x] > eq
Expand Down
5 changes: 2 additions & 3 deletions eo-runtime/src/main/eo/org/eolang/string.eo
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@
+rt jvm org.eolang:eo-runtime:0.0.0
+version 0.0.0

[data] > string
data > @
data > as-bytes
[as-bytes] > string
as-bytes > @

# Is true if both objects are equal
[x] > eq
Expand Down
11 changes: 4 additions & 7 deletions eo-runtime/src/main/java/org/eolang/Data.java
Original file line number Diff line number Diff line change
Expand Up @@ -250,14 +250,11 @@ private static Phi toPhi(final Object obj, final Phi value) {
);
}
if (delta) {
phi.attr("Δ").put(value);
phi.attr(Attr.LAMBDA).put(value);
} else {
phi.attr(0).put(
new PhWith(
new EObytes(Phi.Φ),
"Δ", new Data.Value<>(bytes)
)
);
final Phi bts = new EObytes(Phi.Φ);
bts.attr(Attr.LAMBDA).put(new Data.Value<>(bytes));
phi.attr(0).put(bts);
}
return phi;
}
Expand Down

0 comments on commit 195be9e

Please sign in to comment.