Implement mutable/immutable variables #17
Labels
No Label
bug
documentation
enhancement
help wanted
management
package: analyzer
package: compiler
package: errors
package: fsplc
package: generator
package: lexer
package: llvm
package: parser
performance
priority
question
refactor
status
backburner
status
duplicate
status
invalid
status
ongoing
status
wontfix
test
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: fspl/fspl#17
Loading…
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