Live data from Hacker News

Functional Language Features in Rust – Iterators and Closures

rust-lang.github.io

1–10 of 42 posts

Re: Functional Language Features in Rust – Iterators and Closures

#5

For context: there's a rewrite of the rust book in progress for a while now. This is a chapter of that book.

Yes. Co-author here, happy to answer any questions or hear feedback on the text, as usual.

Incidentally, I just finished the build system stuff today to get the new book shipped on doc.rust-lang.org; that slates it to land in Rust 1.18. It will still be a draft, but this is one more step towards it being finished.

Re: Functional Language Features in Rust – Iterators and Closures

#6

Please don't take over my Cmd+Left arrow key for going back, Chrome already took away my backspace :(

I totally agree. Is there a more general solution beside pages deciding to behave? Would making some select list of key combinations not overridable help? Or would that break too many pages?

Re: Functional Language Features in Rust – Iterators and Closures

#8
post #7

Iterators of this form are not functional construct, they are a pattern from object-oriented programming.

The way iterators are used in Rust is reminiscent of the use of lazy lists in, like, Haskell, enabling a distinctly functional-ish style.

Re: Functional Language Features in Rust – Iterators and Closures

#9
post #7

Iterators of this form are not functional construct, they are a pattern from object-oriented programming.

This is why we say

> We're going to sidestep the issue of what, exactly, functional programming is or is not, and instead show off some features of Rust that are similar to features in many languages referred to as functional.

Many people think of "programming with higher order functions" to be a feature of functional languages, and that may be wrong, but it's also okay. The goal is to teach the stuff, not worry about what exacty "functional" means.

Re: Functional Language Features in Rust – Iterators and Closures

#10
post #7

Iterators of this form are not functional construct, they are a pattern from object-oriented programming.

This is why we say > We're going to sidestep the issue of what, exactly, functional programming is or is not, and instead show off some features of Rust that are similar to features in many languages referred to as functional. Many people think of "programming with higher order functions" to be a feature of functional languages, and that may be wrong, but it's also okay. The goal is to teach the stuff, not worry abou…

OK, but if you avoided calling non-functional patterns part of functional programming, you would avoid invoking the topic of "what constitutes functional programming" altogether.
Post reply on HN