Implement mutable/immutable variables #17
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
On https://git.tebibyte.media/fspl/fspl/src/branch/implement-mutable-variables
The only scenario in which mutability matters is in assignment statements, as there are a fixed amount of assignment scenarios:
There is no sub-scenario in which it would make sense for scenarios 1 or 2 to reject an assignment based on their type. It would absolutely make sense to consider mutability when determining (within the analyzer) whether an expression is a location expression or not. However, this would not allow indexing into an immutable composite/aggregate type. Perhaps it would be wise to create a mutability testing function that is only used in assignment instead.
This mechanism could also be used for enumerated constants.
This would not require any refactoring of the analyzer which is good because oh god