python’s yield is useful in fib
RIIR
RIIP
but I haven’t figure how to get it from recursive function…
may help,use struct + closure function to acted like outside。
in py,we make a iter,then yield。then add a function at its outside。
but in rust,we change the form of function。
^ the above content can be found from
the algebra of programming
foldl + op can get new op.
事实上, 考虑这样一个过程
用线性的写法就是
换句话说就是 fold
下面简单说说为啥在无 GC 语言 c/cpp/rust 里生成器是老大难问题.(等 zig 1.0 我再考虑补上)
cpp 在 20 有了
co_
系列 keywordrust 这个也 nightly 了
考虑最简单的问题