-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into gabor/parentheticals
- Loading branch information
Showing
119 changed files
with
1,226 additions
and
621 deletions.
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
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,6 +1,6 @@ | ||
import Debug "mo:base/Debug"; | ||
|
||
actor Alarm { | ||
persistent actor Alarm { | ||
|
||
let n = 5; | ||
var count = 0; | ||
|
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,21 +1,23 @@ | ||
import Nat "mo:base/Nat"; | ||
import Map "mo:base/RBTree"; | ||
import Map "mo:base/OrderedMap"; | ||
|
||
actor class Bucket(n : Nat, i : Nat) { | ||
persistent actor class Bucket(n : Nat, i : Nat) { | ||
|
||
type Key = Nat; | ||
type Value = Text; | ||
|
||
let map = Map.RBTree<Key, Value>(Nat.compare); | ||
transient let keyMap = Map.Make<Key>(Nat.compare); | ||
|
||
var map : Map.Map<Key, Value> = keyMap.empty(); | ||
|
||
public func get(k : Key) : async ?Value { | ||
assert((k % n) == i); | ||
map.get(k); | ||
keyMap.get(map, k); | ||
}; | ||
|
||
public func put(k : Key, v : Value) : async () { | ||
assert((k % n) == i); | ||
map.put(k,v); | ||
map := keyMap.put(map, k, v); | ||
}; | ||
|
||
}; |
Oops, something went wrong.