fubark / cyber

Fast and concurrent scripting.
https://cyberscript.dev
MIT License
1.16k stars 38 forks source link

fiber example on the landing page not working #70

Closed FObersteiner closed 10 months ago

FObersteiner commented 10 months ago

the example on https://cyberscript.dev/index.html

var count = 0    -- Counts iterations.
var fiber = coinit fib(30)
var res = 0
while fiber.status() != #done:
    res = coresume fiber
    count += 1
print '{res} {count}'

doesn't seem to work for me (just updated to cyber 0.2). If I run it as it is, I get

CompileError: Unsupported node

/.../hello.cy:18:25:
while fiber.status() != #done:
                        ^

From how I understand the docs, it should be while fiber.status() != '#done':, no? However, if I use that, the code just goes into an infinite loop.


update just found the solution here:

fubark commented 10 months ago

Thanks, I've updated the docs. The landing page will get updated when 0.3 is released!