2024-02-29 12:23:34 +03:00
|
|
|
aqua Main
|
2024-01-09 19:31:37 +03:00
|
|
|
|
2024-02-29 12:23:34 +03:00
|
|
|
export bugLNG346
|
2024-02-20 15:52:54 +03:00
|
|
|
|
2024-02-29 12:23:34 +03:00
|
|
|
ability Promise:
|
|
|
|
yield() -> string
|
2024-01-11 11:00:32 +03:00
|
|
|
|
2024-02-29 12:23:34 +03:00
|
|
|
func done_nil() -> string:
|
|
|
|
<- ""
|
|
|
|
|
|
|
|
func done() -> Promise:
|
|
|
|
<- Promise(yield = done_nil)
|
|
|
|
|
|
|
|
ability Compute:
|
|
|
|
yield() -> string
|
|
|
|
|
|
|
|
alias WorkerYield: -> string
|
|
|
|
alias Yield: WorkerYield -> Promise
|
|
|
|
|
|
|
|
func wait_for() -> Yield:
|
|
|
|
wait = func (cb: -> string) -> Promise:
|
|
|
|
yield = func () -> string:
|
|
|
|
e <- cb()
|
|
|
|
<- e
|
|
|
|
<- Promise(yield = yield)
|
|
|
|
<- wait
|
|
|
|
|
|
|
|
ability Function:
|
|
|
|
run(dealId: string) -> string
|
|
|
|
|
|
|
|
func simple{Compute}(yield: Yield) -> Function:
|
|
|
|
deal_run = func () -> string:
|
|
|
|
c_yield = func () -> string:
|
|
|
|
<- Compute.yield()
|
|
|
|
yieeld <- yield(c_yield)
|
|
|
|
res <- yieeld.yield()
|
|
|
|
<- res
|
|
|
|
<- Function(run = deal_run)
|
|
|
|
|
|
|
|
func bugLNG346() -> string:
|
|
|
|
res: *string
|
|
|
|
yieeld = func () -> string:
|
|
|
|
res <<- "hello"
|
|
|
|
<- ""
|
|
|
|
c = Compute(yield = yieeld)
|
|
|
|
fn = simple{c}(wait_for())
|
|
|
|
r <- fn.run("")
|
|
|
|
<- res!
|