aqua-playground/aqua/examples/constants.aqua

18 lines
440 B
Plaintext
Raw Permalink Normal View History

2021-06-15 17:06:08 +03:00
import "@fluencelabs/aqua-lib/builtin.aqua"
2021-04-23 17:21:58 +03:00
2021-04-28 03:26:26 +03:00
service Getter("test"):
2021-06-15 17:06:08 +03:00
createStr: u32 -> string
2021-04-28 03:26:26 +03:00
2021-06-15 17:06:08 +03:00
service OpO("op"):
identity: string -> string
2021-04-23 17:21:58 +03:00
-- a question mark means that this constant could be rewritten before this definition
2021-09-01 15:01:01 +03:00
const ANOTHER_CONST ?= "default-str"
const UNIQUE_CONST ?= 5
2021-04-23 17:21:58 +03:00
2021-06-15 17:06:08 +03:00
func callConstant() -> []string:
res: *string
2021-09-01 15:01:01 +03:00
res <- Getter.createStr(UNIQUE_CONST)
res <- OpO.identity(ANOTHER_CONST)
2021-06-15 17:06:08 +03:00
<- res