2020-02-27 17:51:29 +01:00
|
|
|
//Test simple_access in PascaLIGO
|
|
|
|
|
|
|
|
type tpi is int * int
|
|
|
|
|
|
|
|
type rpi is record [x : int; y : int]
|
|
|
|
|
|
|
|
type mpi is map (string, int)
|
2019-11-12 17:07:09 +00:00
|
|
|
|
|
|
|
function main (const toto : tpi) : int is
|
2020-02-27 17:51:29 +01:00
|
|
|
block {
|
2019-11-18 16:10:48 +01:00
|
|
|
var a : tpi := toto;
|
2020-02-27 17:51:29 +01:00
|
|
|
var b : rpi := record [x=0; y=1];
|
|
|
|
var m : mpi := map ["y" -> 1];
|
2020-02-20 05:25:30 +00:00
|
|
|
a.0 := 2;
|
|
|
|
b.x := a.0;
|
2020-02-27 17:51:29 +01:00
|
|
|
m["x"] := b.x
|
|
|
|
} with
|
|
|
|
case m["x"] of
|
|
|
|
Some (s) -> s
|
|
|
|
| None -> 42
|
|
|
|
end
|