I think the main reason that I love Rust so much is that it's actually logical and functional in ways that were either very gated or very difficult to achieve beforehand. It comes with a lot of different methods and options for extreme method chaining, like above, but it's still understandable. For example, that Either crate? Yeah, with no additional help, I wrote my own implementation of it where it had three different possible branches, and it's just as concise as the original. Most other languages would have you start from scratch or adhere to some syntactic requirements, but Rust actually guides you to the results.
I'm having difficulty imagining a scenario where someone sees a function of this signature and fails to understand what the input parameter's purpose is, but the actual reason I wrote it as is was because "it's fewer characters and that's seemingly what's popularly perceived as 'good' here". I'm frankly surprised that more people haven't submitted this exact solution.
That was a clever one!
I think the main reason that I love Rust so much is that it's actually logical and functional in ways that were either very gated or very difficult to achieve beforehand. It comes with a lot of different methods and options for extreme method chaining, like above, but it's still understandable. For example, that Either crate? Yeah, with no additional help, I wrote my own implementation of it where it had three different possible branches, and it's just as concise as the original. Most other languages would have you start from scratch or adhere to some syntactic requirements, but Rust actually guides you to the results.
This comment is hidden because it contains spoiler information about the solution
I'm having difficulty imagining a scenario where someone sees a function of this signature and fails to understand what the input parameter's purpose is, but the actual reason I wrote it as is was because "it's fewer characters and that's seemingly what's popularly perceived as 'good' here". I'm frankly surprised that more people haven't submitted this exact solution.
Because I was too lazy to copy 9 extra characters.
spoiler flag, plz...
Haha, yeah, I submitted this translation quite some time ago but recall a similar feeling at the time.
Hi,
I have 2 questions:
1- why does "memory leak" happen?
2- how to prevent it?
This comment is hidden because it contains spoiler information about the solution
Indeed, thank you for pointing this out.
sounds like haskell :)
You could try to compile any compile-time errors into run-time errors, though.
:D Very good! I agree 100%!
None of my katas is about prime numbers. So feel free to enjoy them all! :-)