Implement mutable/immutable variables #17

Open
opened 2024-02-08 19:56:42 +00:00 by sashakoshka · 3 comments
Owner
No description provided.
sashakoshka added this to the (deleted) project 2024-02-08 19:56:42 +00:00
sashakoshka added the
enhancement
label 2024-02-08 19:56:48 +00:00
sashakoshka added this to the Q1 2024 milestone 2024-02-08 20:05:32 +00:00
Author
Owner
On https://git.tebibyte.media/fspl/fspl/src/branch/implement-mutable-variables
sashakoshka added the
status
ongoing
label 2024-03-07 02:47:29 +00:00
sashakoshka modified the milestone from Q1 2024 to Q2 2024 2024-03-19 18:30:16 +00:00
sashakoshka removed the
status
ongoing
label 2024-03-19 18:51:01 +00:00
sashakoshka added a new dependency 2024-03-19 18:51:33 +00:00
Author
Owner

The only scenario in which mutability matters is in assignment statements, as there are a fixed amount of assignment scenarios:

  1. Assignment statements
  2. Argument passing to a function or method
  3. Argument passing to a language construct

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.

The only scenario in which mutability matters is in assignment statements, as there are a fixed amount of assignment scenarios: 1. Assignment statements 2. Argument passing to a function or method 3. Argument passing to a language construct 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.
Author
Owner

This would not require any refactoring of the analyzer which is good because oh god

This would not require any refactoring of the analyzer which is good because oh god
sashakoshka removed a dependency 2024-04-09 18:47:49 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: fspl/fspl#17
No description provided.