Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

org.eolang.txt.string-buffer #3584

Open
yegor256 opened this issue Dec 1, 2024 · 0 comments
Open

org.eolang.txt.string-buffer #3584

yegor256 opened this issue Dec 1, 2024 · 0 comments

Comments

@yegor256
Copy link
Member

yegor256 commented Dec 1, 2024

How about we create a new object, which we can use like this in order to build strings:

+tests

# Puts all strings together.
[] > appends-all-together
eq. > @
  malloc.of
    0
    [m] >> 
      string-buffer m > @
      .with "hello"  
      .with ", world"
      .with "!"  
  "hello, world!"

Under the hood, it will use m.resized in order to increase the size of the memory block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant