-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mutable references #140
Comments
The current plan is to support mutable references case class Mut[T](var value: T) In that way we can model the fact, that one can remotely overwrite the entire T i.e. fn foo(x: &mut Bar) {
*x = Bar(...)
} |
Survey of possible problems with mutable references
|
For now, the frontend allows only local mutation and no mutable borrowing for safety reasons. It would however, provide great value to also allow mutable references. This should be possible by targetting the imperative phase of Stainless.
Example in Scala: https://github.com/jad-hamza/stainless/blob/72c0052255878c440e0a1d00260f4ebf04ba5860/frontends/benchmarks/imperative/valid/ReturnWithMutation.scala
The text was updated successfully, but these errors were encountered: