-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
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
Expressive Lambda Expressions #3497
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This RFC simultaneously seems to acknowledge the existence of closures (also focusing very narrowly on RFC 1558) while suggesting an addition to the language that is essentially just closures with a new syntax. What is the difference here?
|
||
## Alternatives | ||
|
||
While closures are powerful and versatile, which involve using the `|args| { code }` notation. they may appear less intuitive, especially to developers accustomed to languages with lambda expressions. Lambda expressions provide a more concise and readable way to define short, anonymous functions, which can lead to improved code maintainability and understandability, especially in situations where functions are used as arguments or returned values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's not really an argument being made here about why closures are less intuitive or why this new syntax is more intuitive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is more like a complement to closures.
Also, honest question -- was this RFC written by a LLM? Sorry if I'm overstepping here, but the way the text of the RFC reads suggests that it may have been. |
Off-topic/grey question. Well, I can't reveal all my secrets, but let's just say I'm here to make Rust even more "LLMazing"! 😄 On a serious note, lambda expressions can be a powerful addition to the language, and I'm here to help answer any questions or concerns you might have about this RFC. |
Well the LLM failed to acknowledge (partly) that Rust already has closures and thus there's no section even comparing the two and how the new syntax would be better. Half of this reads like Rust doesn't have any "lambdas" at all. |
Y'all pressing L + Ratio for no objective reason. It's making me feel really sad 😢. I'mma heading out 🚪🚶. |
dont waste peoples time by opening PRs generated with ai |
I... wha? What is happening!? Why, @wiseaidev? Why are you doing this to us? What did we do to deserve this? |
Nothing worth mentioning, ma fren. I'm simply trying my best to enhance the language, nothing more, nothing less. You're welcome to either accept or decline this PR, and that's perfectly okay. It seems like there's a bit of unnecessary drama surrounding it. And why criticize the author of this PR instead of objectively evaluating the content? |
Machines currently cannot claim copyright on their works, and that does not mean that you can then assert copyright by copying their output and saying "I am a human, therefore it is my work." We rely on contributors having title over what they write, or if they reference outside material, declaring the reference.
The question to answer would have been, "did you use any machine-learning-model-driven tools to generate even one byte of output which you then copied into this pull request?"
Because the content is meaningless if the PR cannot be accepted due to legal considerations. Do you want to be part of a lawsuit for the next 10 years of your life ongoing for every 3 months because you did something as pointless as fudge the truth about whether you used a model to emit text or not? |
The key question here is: How can you tell if it's written by machines or humans? What GPTs and other language models do is quite similar to what we do naturally – they read documents, learn from them, and predict/write/generate relatively new outputs/content, but at a higher scale. So, you could level the same accusation against humans: learning/using copyrighted material, and you cannot claim anything at all. |
@wiseaidev |
(arg1, arg2, ..., argn) -> { // code block }
notation.Rendered