tact-lang / tact

Tact compiler main repository
https://tact-lang.org
MIT License
280 stars 56 forks source link

Map data structure with length operation which costs O(1) #471

Open anton-trunov opened 5 days ago

anton-trunov commented 5 days ago

This is a popular request -- to have a map type with the length operation which costs O(1).

It should be implementable in Tact itself using structs with extension functions, for instance. But there is a drawback to this approach: the user can overwrite the length field of the underlying struct. This looks like a good use-case to introduce private struct fields.