-
Notifications
You must be signed in to change notification settings - Fork 119
WIP: stable function upgrade examples #5354
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
base: luc/stable-functions
Are you sure you want to change the base?
WIP: stable function upgrade examples #5354
Conversation
| @@ -0,0 +1,14 @@ | |||
| //ENHANCED-ORTHOGONAL-PERSISTENCE-ONLY | |||
| //SKIP ic-ref-run | |||
| import Clamper "Clamper"; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file missing from the PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a leftover file. I removed it in favor of brittle-stable-functions.drun
| persistent actor { | ||
| class Clamper(l : Nat, h : Nat) { | ||
| public func clamp(x : Nat) : Nat { | ||
| // When trying to evolve this class to hardcode the upper limit, |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
| @@ -0,0 +1,15 @@ | |||
| persistent actor { | |||
| class Clamper(low : Nat, high : Nat) { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't tell from the log if the upgrade from Initial to Renamed works or not. I suspect it should from the PR description, but does it fail?
The closures of stable functions are represented in a portable format with the following clearly defined binding of captured variables:
Local variables are captured by name.
Parameters are captured by position (also considering nested functions).
I guess some printfs might help
No description provided.