Retoor software development Projects Research SearchXNG
Register Sign In

10 lines
272 B
Plaintext
Raw Normal View History

feat: implement symmetric coroutines with fiber.call and fiber.run distinction Add new `fiber.call` method that remembers the calling fiber for symmetric transfer, while `fiber.run` now performs tail-call style switching without preserving the caller. Introduce re-entrancy guards preventing a fiber from being called multiple times, update all test fixtures to use the new API, and add comprehensive test coverage for call semantics including direct/indirect re-entrancy, value passing, and finished fiber errors.
2014-04-14 16:23:05 +02:00
var a = new Fiber {
Fiber.yield(1) // expect runtime error: No fiber to yield to.
}
// Run a chain of fibers. Since none of them are called, they all get discarded
// and there is no remaining caller.
feat: allow empty argument list methods in calls, definitions, and docs - Compile empty `()` as a valid method signature distinct from no parentheses - Update `call()`, `clear()`, `run()`, `try()`, and `yield()` to use empty argument lists - Revise documentation across multiple files to reflect new signature semantics
2015-02-27 08:08:36 +01:00
var b = new Fiber { a.run() }
var c = new Fiber { b.run() }
c.run()
Reference in New Issue Copy Permalink
fdcd1fdf03
wren/test/fiber/yield_with_value_with_no_caller.wren
Response time: 156ms
Mail Licenses API