We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Iterator
05-Iterator 一章中提到:
05-Iterator
Iterator在函数式编程中是居于最核心的地位。
但事实上 Iterator 的接口设计加上整个 Rust 的计算模型和函数式范式相去甚远。这个灵魂函数 Iterator::next 的第一个参数是 &mut self,实际上在鼓励实现者使用可变的内部状态来进行迭代,事实上很多实现结构也是如此。而函数式的一大特性就是不可变性,这样改变内部状态的做法并不 idiomatic。
Iterator::next
&mut self
The text was updated successfully, but these errors were encountered:
No branches or pull requests
05-Iterator
一章中提到:但事实上
Iterator
的接口设计加上整个 Rust 的计算模型和函数式范式相去甚远。这个灵魂函数Iterator::next
的第一个参数是&mut self
,实际上在鼓励实现者使用可变的内部状态来进行迭代,事实上很多实现结构也是如此。而函数式的一大特性就是不可变性,这样改变内部状态的做法并不 idiomatic。The text was updated successfully, but these errors were encountered: