Opportunistic mutation #1
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: scott/rudus#1
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?
imbl
allows for opportunistic mutation of data structures, which is good! However, just about everything in the Ludus vm assumes no mutation, only borrowing. Soconcat
has to create new strings and lists. This isn't the worst, but it's not great, either.So, for example, I can't mutably borrow out of an argument tuple, which currently has type
Rc<Vec<Value<'src>>>
.One reason to separate Base from Prelude is that Base functions should be able to mutate their arguments, whereas Prelude never does, excepting cases of opportunistic mutation. So one project here is to shift all Base values to take
&mut Value
arguments. This may require distinguishing between those that mutate and those that don't (e.g.Binary
vsBinaryMut
). That's fine.