Register based error-handling?

via Digitalmars-d digitalmars-d at puremagic.com
Thu Nov 6 12:58:00 PST 2014


On Thursday, 6 November 2014 at 20:06:55 UTC, deadalnix wrote:
> I don't think we should have a language construct for that. It 
> is
> possible to pack the returned value in a struct that enforce
> error checking.

How?

Please note that inconvenient is not an option since people then 
will end up with the classical "use an illegal value to convey 
error":

As a consequence error is sometimes -1 and sometimes 0 and 
sometimes NaN, so you have to rely on docs.

>Exception is fine for procedure if they can't do their job.

The problem is that they don't perform well. They don't really 
belong in system level programming and there are no inconvenient 
non-noisy alternatives.


More information about the Digitalmars-d mailing list