News for hackers. Stuff that matters.
Re:C++ and the Culture of Complexity (2013) by masklinn on Wednesday January 31, 2018 @01:07PM (#16275976)
FWIW

> Result which is a plain old datatype written in the language, though admittedly it relies on a macro for use

It does not. It relies on a special construct (!) or macro (try!) for convenience, but these are not necessary (a popular alternative is to use the various HoFs instead) and desugar to pretty trivial (if possibly repetitive) code:

    macro_rules! try {
        ($expr:expr) => (match $expr {
            $crate::result::Result::Ok(val) => val,
            $crate::result::Result::Err(err) => {
                return $crate::result::Result::Err($crate::convert::From::from(err))
            }
        })
    }
Re:C++ and the Culture of Complexity (2013) by lmm on Friday February 02, 2018 @07:41AM (#16290068)
I don't think Result would be seen as an acceptable replacement for exceptions without the macro/special construct. But I should've been clearer.
Re:C++ and the Culture of Complexity (2013) by steveklabnik on Wednesday January 31, 2018 @08:28PM (#16279076)
(It's ? not !)
Re:C++ and the Culture of Complexity (2013) by masklinn on Thursday February 01, 2018 @03:37AM (#16280402)
(You're right of course, not sure what I was thinking)