You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently arrays are just stored as Array<Value> which wastes a lot of space as the tag information in the enum is duplicated. A better way would be to have multiple array types (Array, Array, Array and maybe even Array if a byte type were added).
Though the idea is straightforward the implementation may have some subtleties. For instance consider the following code
lettwice x =[x, x]
twice 1
twice { x =1}
When constructing an array in the twice function the tag of x needs to be inspected so the correct array can be constructed. A similar problem comes when indexing an array where the code has to check the type of the array to construct the correct Value variant. Theses issues aren't to complicated but there may be other problems hiding as well.
The text was updated successfully, but these errors were encountered:
Currently arrays are just stored as
Array<Value>
which wastes a lot of space as the tag information in the enum is duplicated. A better way would be to have multiple array types (Array, Array, Array and maybe even Array if a byte type were added).Though the idea is straightforward the implementation may have some subtleties. For instance consider the following code
When constructing an array in the
twice
function the tag ofx
needs to be inspected so the correct array can be constructed. A similar problem comes when indexing an array where the code has to check the type of the array to construct the correctValue
variant. Theses issues aren't to complicated but there may be other problems hiding as well.The text was updated successfully, but these errors were encountered: