ligo/src/test/contracts/tuple.ligo

19 lines
385 B
Plaintext
Raw Normal View History

2020-02-27 17:51:29 +01:00
type abc is int * int * int
2019-05-12 20:56:22 +00:00
2020-02-27 17:51:29 +01:00
function projection_abc (const tpl : abc) : int is tpl.1
2019-05-12 20:56:22 +00:00
function modify_abc (const tpl : abc) : abc is
block {
2020-02-27 17:51:29 +01:00
tpl.1 := 2048
2019-05-12 20:56:22 +00:00
} with tpl
2020-02-27 17:51:29 +01:00
type foobar is int * int
2019-05-12 20:56:22 +00:00
2020-02-27 17:51:29 +01:00
const fb : foobar = (0,0)
2019-05-12 20:56:22 +00:00
2020-02-27 17:51:29 +01:00
function projection (const tpl : foobar) : int is tpl.0 + tpl.1
2019-05-12 20:56:22 +00:00
2020-02-27 17:51:29 +01:00
type big_tuple is int * int * int * int * int
2019-05-12 20:56:22 +00:00
const br : big_tuple = (23, 23, 23, 23, 23)