eo icon indicating copy to clipboard operation
eo copied to clipboard

object "ram" and refactoring of "heap"

Open yegor256 opened this issue 2 years ago • 4 comments

Let's introduce a new object ram, which will have just two sub-atoms:

[size] > ram
  [p b] > write /bool
  [p] > read /bytes

It should be possible to create a block of random-access byte array and then write a few bytes there and read them back:

ram 1024 > m
m.write 100 ("hello".as-bytes)
(m.read 100).eq ("hello".as-bytes)

And then refactor the object heap so that it doesn't have any atoms, but only encapsulate this new ram.

yegor256 avatar Dec 19 '21 10:12 yegor256

@andreoss what do you think about this?

yegor256 avatar Dec 19 '21 10:12 yegor256

@yegor256 Please, assing

andreoss avatar Dec 23 '21 13:12 andreoss

@yegor256 Should there be one more parameter indication the length for read?

[size] > ram
  [p b] > write /bool
  [p l] > read /bytes

andreoss avatar Dec 27 '21 01:12 andreoss

@andreoss yes, you are right

yegor256 avatar Dec 27 '21 05:12 yegor256

@yegor256 @andreoss I believe we can close it. The next step is to solve #684

Graur avatar Nov 14 '22 08:11 Graur

@Graur ok, closing

yegor256 avatar Nov 14 '22 08:11 yegor256