2019-09-04 19:05:45 +02:00
|
|
|
type storage_ is big_map(int, int) * unit
|
2019-10-22 11:55:36 +02:00
|
|
|
type foo is big_map(int, int)
|
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
|
|
|
block {
|
2019-11-18 16:10:48 +01:00
|
|
|
var toto : option (int) := Some(0);
|
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)
|
|
|
|
|
2019-10-22 11:55:36 +02:00
|
|
|
function set_ (var n : int ; var m : foo) : foo is block {
|
|
|
|
m[23] := n ;
|
2019-09-05 17:23:51 +02:00
|
|
|
} with m
|
|
|
|
|
2019-10-22 11:55:36 +02:00
|
|
|
function rm (var m : foo) : foo is block {
|
|
|
|
remove 42 from map m;
|
2019-09-05 17:23:51 +02:00
|
|
|
} with m
|
|
|
|
|
2019-10-22 11:55:36 +02:00
|
|
|
function gf (const m : foo) : int is begin skip end with get_force(23, m)
|
2019-09-05 17:23:51 +02:00
|
|
|
|
2019-10-22 11:55:36 +02:00
|
|
|
function get (const m : foo) : option(int) is begin skip end with m[42]
|
2019-10-18 17:52:26 +02:00
|
|
|
|
|
|
|
const empty_big_map : big_map(int,int) = big_map end
|
|
|
|
|
2019-10-22 11:55:36 +02:00
|
|
|
const big_map1 : big_map(int,int) = big_map
|
2019-10-18 17:52:26 +02:00
|
|
|
23 -> 0 ;
|
|
|
|
42 -> 0 ;
|
2019-10-22 11:55:36 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
function mutimaps (const m : foo ; const n : foo) : foo is block
|
|
|
|
{
|
|
|
|
var bar : foo := m ;
|
|
|
|
bar[42] := 0 ;
|
2019-11-18 16:10:48 +01:00
|
|
|
n[42] := get_force(42, bar) ;
|
|
|
|
} with n
|