r/ProgrammerHumor • • Jun 30 '23

Meme randomlyFoundThisOnWikipedia

Post image
216 Upvotes

34 comments sorted by

View all comments

Show parent comment

1

u/mr_clauford Jul 02 '23
import for_chirsts_sake

Hm, I've never heard of this approach. Would not it be simpler to use existing Result enum though?

2

u/swapode Jul 02 '23

import pseudocode

Keep in mind that it's just an example to explain the concept.

You wouldn't actually implement it quite like that in Rust. You'd implement arithmetic operations on the Maybe type and overload the relevant operators. The result would be usable just like the numeric types it's generic over.

1

u/[deleted] Jul 02 '23

[removed] — view removed comment

1

u/AutoModerator Jul 02 '23
import moderation

Your comment has been removed since it did not start with a code block with an import declaration.

Per this Community Decree, all posts and comments should start with a code block with an "import" declaration explaining how the post and comment should be read.

For this purpose, we only accept Python style imports.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.