-
Notifications
You must be signed in to change notification settings - Fork 97
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
experiment: allow stable/flexible modifiers before top-level actor(class) declarations to flip defaults. #4779
Draft
crusso
wants to merge
11
commits into
master
Choose a base branch
from
claudio/stable-default-progdec
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
48fc60b
add stability modifiers before body
crusso 11957b5
don't default TypD, ExpD, ClassD
crusso a43782e
treat actor classes
crusso 2a2d67c
only modify actor keyword
crusso 56ca6ee
working refactoring
crusso 7cbcd2c
refactor grammar for concision
crusso 48584fc
adjust examples
crusso 7beef6a
clarify grammar
crusso 068ae5d
fixup grammar
crusso edc559a
update test; chagne progdec to top_dec
crusso a7298cd
Merge branch 'master' into claudio/stable-default-progdec
crusso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
syntax4.mo:1.1-1.2: syntax error [M0001], unexpected token '*', expected one of token or <phrase> sequence: | ||
<eof> | ||
seplist(<dec>,<semicolon>) <eof> | ||
seplist(<imp>,<semicolon>) seplist(<dec>,<semicolon>) <eof> | ||
seplist(<top_dec>,<semicolon>) <eof> | ||
seplist(<imp>,<semicolon>) seplist(<top_dec>,<semicolon>) <eof> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
syntax6.mo:1.8-1.9: syntax error [M0001], unexpected token '}', expected one of token or <phrase> sequence: | ||
<eof> | ||
; seplist(<dec>,<semicolon>) | ||
; seplist(<top_dec>,<semicolon>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
syntax7.mo:32.1-32.4: syntax error [M0001], unexpected token 'let', expected one of token or <phrase> sequence: | ||
<eof> | ||
; seplist(<dec>,<semicolon>) | ||
; seplist(<top_dec>,<semicolon>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101 | ||
ingress Completed: Reply: 0x4449444c0000 | ||
debug.print: 1 | ||
ingress Completed: Reply: 0x4449444c00017d01 | ||
debug.print: {pre = 1} | ||
ingress Completed: Reply: 0x4449444c0000 | ||
debug.print: 2 | ||
ingress Completed: Reply: 0x4449444c00017d02 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101 | ||
ingress Completed: Reply: 0x4449444c0000 | ||
debug.print: 1 | ||
ingress Completed: Reply: 0x4449444c00017d01 | ||
debug.print: {pre = 1} | ||
ingress Completed: Reply: 0x4449444c0000 | ||
debug.print: 2 | ||
ingress Completed: Reply: 0x4449444c00017d02 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
install $ID stable-counter-class/stable-counter-class.mo "" | ||
ingress $ID inc "DIDL\x00\x00" | ||
upgrade $ID stable-counter-class/stable-counter-class.mo "" | ||
ingress $ID inc "DIDL\x00\x00" |
21 changes: 21 additions & 0 deletions
21
test/run-drun/stable-counter-class/stable-counter-class.mo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import Prim "mo:⛔"; | ||
|
||
stable actor class Counter() { | ||
|
||
var count : Nat = 0; | ||
|
||
public func inc() : async Nat { | ||
count += 1; | ||
Prim.debugPrint (debug_show(count)); | ||
count | ||
}; | ||
|
||
system func preupgrade() { | ||
Prim.debugPrint (debug_show({pre=count})); | ||
} | ||
|
||
// let f = func(){}; // rejected as unstable | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
install $ID stable-counter/stable-counter.mo "" | ||
ingress $ID inc "DIDL\x00\x00" | ||
upgrade $ID stable-counter/stable-counter.mo "" | ||
ingress $ID inc "DIDL\x00\x00" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
If we don't like the option of
flexible actor (class...)
we could just rule this production out...