proposed minor change to iBase

Jason Kraftcheck kraftche at cae.wisc.edu
Tue Nov 3 17:21:58 CST 2009


Mark Miller wrote:
> I don't have any experience/history of this enum within TSTT/ITAPS
> context.
> 
> However, I recall having a similar library setting in another project.
> It was designed to support two modes of interaction with the library...
> 
>         1. Test the return value (or error code in case of ITAPS) where
>         an application was coded like so...
>         
>         iMesh_newMesh(...&err);
>         if (err != iBase_SUCCESS)
>             do something for error
>         
>         2. Try/catch mode where the application was coded like this...
>         
>         TRY {
>             iMesh_newMesh(...);
>         } CATCH {
>             do something for error
>         } ENDTRY
> 
> The calling application would TELL the library how to behave; either
> throw or return with error code set. The library would then behave as
> the caller wished. However, we wrote the library from scratch with this
> in mind. Retro-fitting existing implementations -- if they were not
> already set up for this -- may be more trouble than its worth.
> 
> Nonetheless, I think this kind of control is useful as it permits both
> programming styles.
> 

That's interesting but not applicable here:  a) no C standard yet includes
exceptions and b) the values for the enum are:
   enum ErrorActions {
      SILENT,                 // does nothing, not recommended
      WARN_ONLY,	      // prints something, but nothing else
      THROW_ERROR             // throws an exception
   };



More information about the tstt-interface mailing list