motoko icon indicating copy to clipboard operation
motoko copied to clipboard

feat: random-access indexing into `Blob`

Open ggreif opened this issue 8 months ago • 2 comments

TODO:

  • [x] compiler for get
  • [x] desugar blob[i] to get (other way 'round!)
  • [x] blob.keys()
  • [x] documentation
  • [x] Changelog.md

ggreif avatar Apr 07 '25 22:04 ggreif

Comparing from 6ecc76fccef0eb59528562c4c133a650e24f0ad0 to 0a912241ad313171cf0bdb1136173701cc1cb336: In terms of gas, no changes are observed in 5 tests. In terms of size, no changes are observed in 5 tests.

github-actions[bot] avatar Apr 07 '25 23:04 github-actions[bot]

Related to https://github.com/dfinity/motoko/issues/966

Should we consider that issue closed by this PR, or could we at least use it as an opportunity to define a list of operations we'd like to see on Blob?

christoph-dfinity avatar Apr 15 '25 07:04 christoph-dfinity

I'm not saying we shouldn't just asking for the motivation given that we have syntax for indexing (now for blobs too) and assignment.

We want parity with [T].

ggreif avatar Apr 16 '25 12:04 ggreif