From c60728326ed926255800fe3064f818a4aeaff8c5 Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Sun, 30 Aug 2015 13:11:27 +0100 Subject: [PATCH] Add :idx: for `suspend` in coro module. --- lib/pure/coro.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/pure/coro.nim b/lib/pure/coro.nim index b2a7692bb..8fa529474 100644 --- a/lib/pure/coro.nim +++ b/lib/pure/coro.nim @@ -50,6 +50,8 @@ proc start*(c: proc(), stacksize: int=defaultStackSize) = proc suspend*(sleepTime: float=0) = ## Stops coroutine execution and resumes no sooner than after ``sleeptime`` seconds. ## Until then other coroutines are executed. + ## + ## This is similar to a `yield`:idx:, or a `yieldFrom`:idx in Python. var oldFrame = getFrame() var sp {.volatile.}: pointer GC_setCurrentStack(current.stack, cast[pointer](addr sp))