-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
25 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
From Perennial.goose_lang Require Export lang notation. | ||
From New.golang.defn Require Export exception list typing noop loop struct mem | ||
slice map string interface defer chan builtin array. | ||
slice map string interface defer chan builtin array globals. | ||
Open Scope struct_scope. |
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,24 @@ | ||
From New.golang.defn Require Export mem typing. | ||
|
||
Module globals. | ||
Section defns. | ||
Context `{ffi_syntax}. | ||
|
||
Definition get : val := | ||
λ: "x", match: GlobalGet "x" with | ||
SOME "x" => "x" | ||
| NONE => #() #() | ||
end. | ||
|
||
Definition put: val := | ||
λ: "x" "y", GlobalPut "x" "y". | ||
|
||
Definition is_uninitialized : val := | ||
λ: "pkgId", | ||
match: GlobalGet "pkgId" with | ||
SOME <> => #false | ||
| NONE => #true | ||
end. | ||
|
||
End defns. | ||
End globals. |