Earlier quoted context omitted.
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.
OK, but if you avoided disputing the definition of a word the author explicitly said was irrelevant, you would avoid invoking the topic of "what constitutes functional programming" altogether.
Functional Language Features in Rust – Iterators and Closures
31–40 of 42 posts
Re: Functional Language Features in Rust – Iterators and Closures
#32Earlier quoted context omitted.
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.
What specifically does "functional programming" mean to you and why do these features not qualify?
And then, what specifically does "functional programming" mean to you that makes implementing an interface a feature from functional paradigm?
But this all misses the point of my comment. If you knew it would invoke the unnecessary discussion to call the iterator "functional feature" (as the quoted comment signifies), you should have rephrased the title of the chapter in the first place, rendering the disclaimer unnecessary.
Re: Functional Language Features in Rust – Iterators and Closures
#33Earlier quoted context omitted.
What specifically does "functional programming" mean to you and why do these features not qualify?
Certainly functional programming is not making the data containers to fulfil a separately defined interface. This comes from OOP paradigm (its form that is implemented in most languages). And then, what specifically does "functional programming" mean to you that makes implementing an interface a feature from functional paradigm? But this all misses the point of my comment. If you knew it would invoke the unnecessary…
Re: Functional Language Features in Rust – Iterators and Closures
#34That was really well written. As I was reading through the example code in the section about closures let add_one = |x| x + 1; let five = add_one(4); I thought to myself "hmm I wonder what happens if I were to call the code with a float rather than an int?" Answered my question a few paragraphs down. Kudos. Is it possible to write a generic closure? i.e something that would add 1 to any numeric type.
Re: Functional Language Features in Rust – Iterators and Closures
#35Under the "Improving our I/O Project" section, there's this little paragraph: It would be nice if we could use ? on the Option returned from next, but ? only works with Result values currently. Even if we could use ? on Option like we can on Result, the value we would get would be borrowed, and we want to move the String from the iterator into Config. It seems remiss to not mention that Option/Result have combinators…
Re: Functional Language Features in Rust – Iterators and Closures
#36Earlier quoted context omitted.
Certainly functional programming is not making the data containers to fulfil a separately defined interface. This comes from OOP paradigm (its form that is implemented in most languages). And then, what specifically does "functional programming" mean to you that makes implementing an interface a feature from functional paradigm? But this all misses the point of my comment. If you knew it would invoke the unnecessary…
You didn't answer my question.
Re: Functional Language Features in Rust – Iterators and Closures
#37Under the "Improving our I/O Project" section, there's this little paragraph: It would be nice if we could use ? on the Option returned from next, but ? only works with Result values currently. Even if we could use ? on Option like we can on Result, the value we would get would be borrowed, and we want to move the String from the iterator into Config. It seems remiss to not mention that Option/Result have combinators…
Please don't quote with code blocks.
Re: Functional Language Features in Rust – Iterators and Closures
#38Earlier quoted context omitted.
Please don't quote with code blocks.
Umm...If I don't quote the entire code snippet, I'll end up with just the indented lines being quoted...the joys of HN formatting.
> Umm...If I don't quote the entire code snippet, I'll end up with just the indented lines being quoted...the joys of HN formatting.
This allows for responsive formatting on different screen sizes, and is especially beneficial for mobile users.
Re: Functional Language Features in Rust – Iterators and Closures
#39Earlier quoted context omitted.
What specifically does "functional programming" mean to you and why do these features not qualify?
> In computer science, functional programming is a programming paradigm—a style of building the structure and elements of computer programs—that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data. from https://en.wikipedia.org/wiki/Functional_programming I totally agree that neither iterators nor 2/3s of closures are "functional programming". That's fine, though,…
I think it's fair to say that iterator methods are typically used as combinators to build computations out of pure functions to avoid having to manage mutable state.
Re: Functional Language Features in Rust – Iterators and Closures
#40Earlier quoted context omitted.
What specifically does "functional programming" mean to you and why do these features not qualify?
Certainly functional programming is not making the data containers to fulfil a separately defined interface. This comes from OOP paradigm (its form that is implemented in most languages). And then, what specifically does "functional programming" mean to you that makes implementing an interface a feature from functional paradigm? But this all misses the point of my comment. If you knew it would invoke the unnecessary…