News for hackers. Stuff that matters.
Re:Optional If Expressions by SeanLuke on Saturday April 15, 2023 @07:34AM (#35579664)
I guess the Lisp example is an example of a nullable type, which he's railing against; he'd rather have prewrapped types like Some(result) vs None. But it's still an optional expression, and I'm not convinced that declaring an optional type, doing the expression(s), then unwrapping and checking the result for None, is any better than just using an exception handler. He insists that nullable types force you to check for null, but they don't, at least in his math example here. Just let the runtime do it and throw an exception.
Re:Optional If Expressions by f_devd on Saturday April 15, 2023 @08:02AM (#35579823)
> Just let the runtime do it and throw an exception.

Afaik there are no exceptions in rust only panics & `Result`s (and `Option` I suppose)