diff --git a/eo-runtime/src/main/eo/org/eolang/bytes.eo b/eo-runtime/src/main/eo/org/eolang/bytes.eo index f88150abab..ac9a474ecf 100644 --- a/eo-runtime/src/main/eo/org/eolang/bytes.eo +++ b/eo-runtime/src/main/eo/org/eolang/bytes.eo @@ -35,7 +35,6 @@ data > @ $ > as-bytes $.eq 01- > as-bool - string $ > as-string # Turn this chain of eight bytes into a number. # If there are less or more than eight bytes, there will diff --git a/eo-runtime/src/main/eo/org/eolang/fs/dir.eo b/eo-runtime/src/main/eo/org/eolang/fs/dir.eo index 3077d23dfc..fc64d655d5 100644 --- a/eo-runtime/src/main/eo/org/eolang/fs/dir.eo +++ b/eo-runtime/src/main/eo/org/eolang/fs/dir.eo @@ -90,7 +90,8 @@ [] > tmpfile if. > @ ^.exists - QQ.fs.file touch.as-bytes.as-string + QQ.fs.file + string touch.as-bytes error sprintf "Directory %s does not exist, can't create temporary file" diff --git a/eo-runtime/src/main/eo/org/eolang/fs/file.eo b/eo-runtime/src/main/eo/org/eolang/fs/file.eo index fc31319aed..dcbbd65757 100644 --- a/eo-runtime/src/main/eo/org/eolang/fs/file.eo +++ b/eo-runtime/src/main/eo/org/eolang/fs/file.eo @@ -78,7 +78,8 @@ # Move current file to `target`, making and returning a new `file` from it. [target] > moved - QQ.fs.file move.as-bytes.as-string > @ + QQ.fs.file > @ + string move.as-bytes # Tries to move file from `^.path` to `target` # and returns path of moved file as `string`. diff --git a/eo-runtime/src/main/eo/org/eolang/fs/path.eo b/eo-runtime/src/main/eo/org/eolang/fs/path.eo index 88a61efd62..e6e05bb7e1 100644 --- a/eo-runtime/src/main/eo/org/eolang/fs/path.eo +++ b/eo-runtime/src/main/eo/org/eolang/fs/path.eo @@ -43,7 +43,7 @@ # Utility object that joins given `tuple` of paths with current OS separator # and normalizes result path. [paths] > joined - as-string. > joined-path + string > joined-path as-bytes. joined. text ^.separator @@ -132,11 +132,10 @@ -- determined. > @ ^.^.posix - as-string. - if. - normalized.eq "//" - "/" - normalized + if. + normalized.eq "//" + "/" + string normalized # Resolves `other` path against `^.uri` and returns as new `path` from it. # The original `uri` and resolving `other` may be: @@ -269,7 +268,7 @@ "\\" > separator determined. > @ validated - as-string. + string as-bytes. validated.separated-correctly uri @@ -397,11 +396,10 @@ -- determined. > @ ^.^.validated - as-string. - if. - normalized.eq "\\\\" - ^.separator - normalized + if. + normalized.eq "\\\\" + ^.separator + string normalized # Resolves `other` path against `^.uri` and returns as new `path` from it. # Original `uri` and `other` path for resolving may be: diff --git a/eo-runtime/src/main/eo/org/eolang/txt/text.eo b/eo-runtime/src/main/eo/org/eolang/txt/text.eo index d7da838bef..c70255859f 100644 --- a/eo-runtime/src/main/eo/org/eolang/txt/text.eo +++ b/eo-runtime/src/main/eo/org/eolang/txt/text.eo @@ -108,17 +108,17 @@ ^.origin > delimiter! items.at 0 > first items.length > len! + if. > not-empty! + 1.eq len + first + concat. + first.as-bytes + with-delimiter "".as-bytes 1 text > @ if. 0.eq len "" - if. - 1.eq len - first - as-string. - concat. - first.as-bytes - with-delimiter "".as-bytes 1 + string not-empty [acc index] > with-delimiter if. > @ @@ -146,7 +146,7 @@ if. 0.eq amount "" - as-string. + string rec-repeated bts 1 [accum index] > rec-repeated @@ -249,7 +249,7 @@ number ascii-a ascii "A" text > @ - as-string. + string reduced. list bytes-as-array @@ -282,7 +282,7 @@ ^.up-cased.ascii "Z" > ascii-z ^.up-cased.ascii "A" > ascii-a text > @ - as-string. + string reduced. list bytes-as-array @@ -349,7 +349,7 @@ block.from.minus start ^.replacement block.to - as-string. + string accum.concat ^.reinit.slice start @@ -404,7 +404,7 @@ 0.eq others.length ^ text - as-string. + string reduced. list others ^.origin.as-bytes 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 97ba7c7c7d..95da0e2396 100644 --- a/eo-runtime/src/test/eo/org/eolang/bytes-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/bytes-tests.eo @@ -55,7 +55,7 @@ # This unit test is supposed to check the functionality of the corresponding object. [] > turns-bytes-into-a-string eq. > @ - as-string. + string E4-BD-A0-E5-A5-BD-2C-20-D0-B4-D1-80-D1-83-D0-B3-21 "你好, друг!" @@ -351,8 +351,7 @@ "hello ".as-bytes "world".as-bytes eq. > @ - as-string. - s-bytes + string s-bytes "hello world" # This unit test is supposed to check the functionality of the corresponding object. diff --git a/eo-runtime/src/test/java/EOorg/EOeolang/EObytesEOconcatTest.java b/eo-runtime/src/test/java/EOorg/EOeolang/EObytesEOconcatTest.java index ac572a99b8..9d7a5abe79 100644 --- a/eo-runtime/src/test/java/EOorg/EOeolang/EObytesEOconcatTest.java +++ b/eo-runtime/src/test/java/EOorg/EOeolang/EObytesEOconcatTest.java @@ -50,13 +50,14 @@ final class EObytesEOconcatTest { void concatenatesBytes() { final Phi current = new Data.ToPhi("привет ").take("as-bytes"); final Phi provided = new Data.ToPhi("mr. ㄤㄠ!").take("as-bytes"); - final Phi phi = new PhMethod( + final Phi phi = new PhWith( + Phi.Φ.take("org.eolang.string"), + 0, new PhWith( current.take("concat").copy(), "b", provided - ), - "as-string" + ) ); MatcherAssert.assertThat( AtCompositeTest.TO_ADD_MESSAGE,