2019-09-04 19:05:45 +02:00
|
|
|
type storage_ is big_map(int, int) * unit
|
2019-08-29 13:12:06 +02:00
|
|
|
|
|
|
|
function main(const p : unit; const s : storage_) : list(operation) * storage_ is
|
2019-09-03 18:33:30 +02:00
|
|
|
var toto : option (int) := Some(0);
|
|
|
|
block {
|
2019-10-18 17:36:33 +02:00
|
|
|
toto := s.0[23];
|
|
|
|
s.0[2] := 444;
|
2019-09-03 18:33:30 +02:00
|
|
|
}
|
2019-09-05 17:23:51 +02:00
|
|
|
with ((nil: list(operation)), s)
|
|
|
|
|
|
|
|
function set_ (var n : int ; var m : storage_) : storage_ is block {
|
2019-10-18 17:36:33 +02:00
|
|
|
m.0[23] := n ;
|
2019-09-05 17:23:51 +02:00
|
|
|
} with m
|
|
|
|
|
|
|
|
function rm (var m : storage_) : storage_ is block {
|
2019-10-18 17:36:33 +02:00
|
|
|
remove 42 from map m.0;
|
2019-09-05 17:23:51 +02:00
|
|
|
} with m
|
|
|
|
|
|
|
|
function gf (const m : storage_) : int is begin skip end with get_force(23, m.0)
|
|
|
|
|
2019-10-18 17:52:26 +02:00
|
|
|
function get (const m : storage_) : option(int) is begin skip end with m.0[42]
|
|
|
|
|
|
|
|
function mutimaps (const m : storage_; const n : storage_) : storage_ is block
|
|
|
|
{
|
|
|
|
var foo : big_map(int,int) := m.0 ;
|
|
|
|
foo[42] := 0 ;
|
|
|
|
n.0[42] := get_force(42, foo) ;
|
|
|
|
} with n
|
|
|
|
|
|
|
|
const empty_big_map : big_map(int,int) = big_map end
|
|
|
|
|
|
|
|
const map1 : big_map(int,int) = big_map
|
|
|
|
23 -> 0 ;
|
|
|
|
42 -> 0 ;
|
|
|
|
end
|