That interface implies global variables... IMO that is a non-starter.
I believe warnings are a special case. Most functions will return errors
rather than warnings. For those that *do* return warnings, they can return a
special structure for it.
Cheers,
-g
On Sat, Feb 03, 2001 at 01:47:10AM +0300, Alexey Mahotkin wrote:
> >>>>> "BC" == Ben Collins-Sussman <sussman@newton.collab.net> writes:
>
> BC> How on earth do we build warnings into this existing system? If now we
> BC> say, "ok, we want all svn_* routines to be able to return *both*
> BC> warnings and errors?", what does our exception handling then look like?
> BC> Do all callers then need to check for both warnings and errors
> BC> separately?
>
> IMHO stack of warnings should be made singleton object (as in design
> pattern).
>
> You could implement it in C using static stack somewhere in warning.c, and
> accessor functions, available in warning.h:
>
> init_warnings();
>
> add_warning(msg);
>
> list = get_warnings();
>
>
> This does not require of you to change interface of any function, and will
> be implemented in no more than 100 lines, including extensive copyright
> info :)
>
> --alexm
--
Greg Stein, http://www.lyra.org/
Received on Sat Oct 21 14:36:21 2006