Re: [AD] 4.3 error handling |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Chris wrote:
I thought the only way to get a local variable onto a register was to use the
register keyword. [...] the
optimizer can do a better and safer job at deciding what should be in
registers and when.
If I'm not mistaken, the line of argumentation is broken here (second
statement contradicting the first).
Anyway, that wasn't my reason for writing.
[Sorry if my client messes formatting up, I have a fealing it will]
> > It's the rare cases that need the most thought. Avoiding problems due
> > to "sloppy coding" by not encouraging them in the first place is
part of
> > good design.
> I'm not sure what you mean here. Are you saying it should be okay for
> a user
> to make sloppy code because we should take care of it for them?
If I understood Peter correctly here, I think he meant something more in
the lines of not encouriging "sloppy coding" by design. That does not
necessarily mean that the library should compromise bad code. If
something could be done a safe way or an unsafe way, then the unsafe way
shouldn't even be an option. Preventing the user from writing bad code
altogether would be more appropriate to say.
Nonetheless, as a C++ programmer I like the idea and I find it worth
considering. I realize that you came up with it quite fast and therefor
probably haven't thought it entirely through (this is not meant as
insult, I'm basing this assumption on a statement of yours in the first
post in this thread). Accordingly, there are still a few things to clear
up. I'm not very familiar with setjmp/longjmp, so my questions might
sound dim-witted, in which case I apologize beforehand.
Is there any differenciation between different types of exceptions?
Like, can an al_catch-block "listen" to a specific kind of exception,
and blatantly ignore others?
Is the "throwing" version of the dynamically-linked library compatible
with its "non-throwing" counter-part, or will the decision which way to
go be made at runtime anyway?
It might help me a great deal if you could list the differences between
C++ native exception handling and your way, I think I still haven't
figured them [the differences] fully out yet.
Yours,
David.