tact-docs icon indicating copy to clipboard operation
tact-docs copied to clipboard

Add more examples of arrays to the Cookbook

Open novusnota opened this issue 1 year ago • 3 comments

As shown here https://github.com/tact-lang/tact/issues/163, we can make something like bit arrays, but allow people to store numbers as byte offsets into the Int type and add subsequent helper wrappers to operate on such "array".

To not pollute global Int method space, we could wrap them into their own struct, like: struct Array32 { u8: Int }.

Additional methods/extension functions could be added, like counting the sum of bytes in the array and such.

P.S.: Solidity has a value/primitive type called Fixed-size byte arrays, which is similar in spirit to what we're trying to do here, so we might just call our arrays the same.

novusnota avatar Jul 10 '24 17:07 novusnota