aqua/aqua-src/so.aqua
2022-03-03 17:54:45 +03:00

32 lines
548 B
Plaintext

service Kademlia("kad"):
neighborhood: -> []string
service Peer("peer"):
timestamp_sec: -> u64
service Op2("op"):
identity: u64 -> u64
func getTwoResults(node: string) -> []u64:
on node:
nodes <- Kademlia.neighborhood()
res: *u64
for n <- nodes par:
on n:
try:
res <- Peer.timestamp_sec()
Op2.identity(res!)
Op2.identity(res!1)
Op2.identity(res!2)
<- res
func makeArray() -> []u64:
<- [1, 3, 5]
func makeOption() -> ?u64:
<- ?[1, 3, 5]
func makeStream() -> *u64:
<- *[1, 3, 5]