zlacker

[parent] [thread] 5 comments
1. brohee+(OP)[view] [source] 2025-12-05 18:16:28
The very useful TryFrom trait landed only in 1.34, so hopefully the code using unwrap_or_else() in From impl predates that...

Actually the From trait documentation is now extremely clear about when to implement it (https://doc.rust-lang.org/std/convert/trait.From.html#when-t...)

replies(1): >>roland+J3
2. roland+J3[view] [source] 2025-12-05 18:31:51
>>brohee+(OP)
As someone unfamiliar with Rust (yet! it's on my ever growing list of things I'd like to absorb into my brain), unwrap_or_else() sounds like part of the "What You See Is What I Threatened the Computer To Do" paradigm.
replies(2): >>Y_Y+G6 >>wongar+wf
◧◩
3. Y_Y+G6[view] [source] [discussion] 2025-12-05 18:45:12
>>roland+J3
> INTERCAL has many other features designed to make it even more aesthetically unpleasing to the programmer: it uses statements such as "READ OUT", "IGNORE", "FORGET", and modifiers such as "PLEASE". This last keyword provides two reasons for the program's rejection by the compiler: if "PLEASE" does not appear often enough, the program is considered insufficiently polite, and the error message says this; if it appears too often, the program could be rejected as excessively polite.
replies(2): >>strbea+Ca >>roland+PW
◧◩◪
4. strbea+Ca[view] [source] [discussion] 2025-12-05 19:00:16
>>Y_Y+G6
Immediately thought of INTERCAL :)
◧◩
5. wongar+wf[view] [source] [discussion] 2025-12-05 19:21:08
>>roland+J3
There are also the equally threatening and useful `map_or_else` (on Result and Option) and `ok_or_else` (on Option and experimentally on bool)
◧◩◪
6. roland+PW[view] [source] [discussion] 2025-12-05 23:18:15
>>Y_Y+G6
Oh wow! That's amazing! "I came to learn Computer Science, but I left with good bedside manners".
[go to top]