mirror of
https://github.com/fluencelabs/aqua.git
synced 2024-12-12 17:55:33 +00:00
99 lines
2.0 KiB
Plaintext
99 lines
2.0 KiB
Plaintext
aqua FooBars declares wait
|
|
|
|
export wait
|
|
|
|
data Record:
|
|
relay_id: []string
|
|
peer_id: string
|
|
|
|
-- func bugLng79(arr: *Record) -> u32:
|
|
-- stream: *Record
|
|
-- for r <- arr:
|
|
-- stream <<- r
|
|
-- someone = stream[0]
|
|
-- on someone.peer_id via someone.relay_id:
|
|
-- a = 1 + 1
|
|
-- <- a
|
|
|
|
service Op1("op"):
|
|
array_length(array: []string) -> u32
|
|
noop()
|
|
identity(s: *string) -> []string
|
|
--
|
|
-- func bugLNG63_3() -> string, u32, []u32:
|
|
-- status: *string
|
|
-- status <<- "ok"
|
|
-- stat = status!
|
|
-- num: *u32
|
|
-- num <<- 2
|
|
-- res = [Op1.array_length(status), num!]
|
|
-- <- status!, Op1.array_length(status), [Op1.array_length(status), 3, num!]
|
|
|
|
-- func emptySugar() -> *string:
|
|
-- strEmptyStream: *string
|
|
-- <- strEmptyStream
|
|
|
|
service Ser("ser"):
|
|
getRecord: -> Record
|
|
|
|
-- func bugLng79(log: string -> ()) -> u32:
|
|
-- stream: *Record
|
|
-- stream <- Ser.getRecord()
|
|
-- someone = stream[0]
|
|
-- on someone.peer_id via someone.relay_id:
|
|
-- a = 1 + 1
|
|
-- <- a
|
|
|
|
-- func streamAssignment(arr: []string) -> string:
|
|
-- stream: *[]u32
|
|
-- stream <<- [0]
|
|
-- a = stream[arr.length - 1][0]
|
|
-- b = arr[a]
|
|
-- <- b
|
|
|
|
-- func streamIntFunctor(arr: []u32) -> string:
|
|
-- stream: *[]string
|
|
-- stream <<- ["123"]
|
|
-- a = stream[arr[0]][arr[0]]
|
|
-- ap-prop = arr[0]
|
|
-- ap-prop inline: ap arr[0] ap-prop
|
|
-- *stream
|
|
-- gate
|
|
-- canon *stream -> #stream_canon_result
|
|
-- ap #stream_canon_result[ap-prop] -> result
|
|
|
|
-- <- a
|
|
|
|
-- service Op2("op"):
|
|
-- identity(s: u64)
|
|
|
|
-- func getTwoResults(node: string) -> []u64:
|
|
-- res: *u64
|
|
-- Op2.identity(res!)
|
|
-- Op2.identity(res!1)
|
|
-- Op2.identity(res!2)
|
|
-- <- res
|
|
|
|
data InnerObj:
|
|
arr: []string
|
|
num: u32
|
|
|
|
data SomeObj:
|
|
str: string
|
|
num: u64
|
|
inner: InnerObj
|
|
|
|
func wait(i: []u32) -> SomeObj:
|
|
<- SomeObj(str = "some str",
|
|
num = 4,
|
|
inner = InnerObj(arr = ["a", "b", "c"], num = i[2])
|
|
)
|
|
|
|
-- func a(nums: []u32) -> []u32:
|
|
-- <- nums
|
|
--
|
|
-- func some():
|
|
-- a([1,2,3,4])
|
|
|
|
|