diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2024-04-19 00:52:30 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-18 18:52:30 +0200 |
commit | 9e1d0d15137c6439d886406293a25eaa16b600c5 (patch) | |
tree | b74463823f235d856e7808d546c3b59b99ad9505 /doc | |
parent | d6823f477672e61017e9c1ce3b5221a2b80fc1b7 (diff) | |
download | Nim-9e1d0d15137c6439d886406293a25eaa16b600c5.tar.gz |
fixes #4695; closure iterators support for JS backend (#23493)
fixes #4695 ref https://github.com/nim-lang/Nim/pull/15818 Since `nkState` is only for the main loop state labels and `nkGotoState` is used only for dispatching the `:state` (since https://github.com/nim-lang/Nim/pull/7770), it's feasible to rewrite the loop body into a single case-based dispatcher, which enables support for JS, VM backend. `nkState` Node is replaced by a label and Node pair and `nkGotoState` is only used for intermediary processing. Backends only need to implement `nkBreakState` and `closureIterSetupExc` to support closure iterators. pending https://github.com/nim-lang/Nim/pull/23484 <del> I also observed some performance boost for C backend in the release mode (not in the danger mode though, I suppose the old implementation is optimized into computed goto in the danger mode) </del> allPathsAsgnResult???
Diffstat (limited to 'doc')
-rw-r--r-- | doc/manual.md | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/doc/manual.md b/doc/manual.md index 9be42d186..3b402e9f4 100644 --- a/doc/manual.md +++ b/doc/manual.md @@ -4673,7 +4673,6 @@ Closure iterators and inline iterators have some restrictions: (but rarely useful) and ends the iteration. 3. Inline iterators cannot be recursive. 4. Neither inline nor closure iterators have the special `result` variable. -5. Closure iterators are not supported by the JS backend. Iterators that are neither marked `{.closure.}` nor `{.inline.}` explicitly default to being inline, but this may change in future versions of the |