Le 17 juin 2011 à 13:21, David Chisnall a écrit :

> Author: theraven
> Date: Fri Jun 17 13:21:20 2011
> New Revision: 6991
> 
> URL: http://svn.gna.org/viewcvs/etoile?rev=6991&view=rev
> Log:
> Make ETException work with the new ABI.
> 
> Quentin: Do we actually want to enable this?  

Not really, but I quite like the concept. I think it might be useful to handle 
exceptions more easily and safely in an interactive environment such as a 
Smalltalk workspace. For example:

Suppose you have an object with a method -do and the object can have various 
possible states A, B, C etc. Now let's say some states (here B) must never be 
visible from the outside, in other words by other objects that can invoke -do. 
Without restartable exceptions, it's hard and tedious to restore the object to 
the state A or C if an exception is raised and handled in some parent calls to 
allow the program to continue cleanly. You basically need to add and expose a 
method like -restoreValidState, and invokes this method in the parent call code.

- do
{
        // go to from A or C to state B

        if (issue)
        {
                [NSException raise];
        }

        // go back to state A or C
}

> I wrote it more as an exercise to see if it would work than as a sensible 
> thing.  I think I'd rather we not enable it in this version, and rewrite it 
> for the next release to use an explicit resume / restart mechanism that is 
> only invoked when raising ETException instances, not try to overload 
> NSException with all of this stuff.

So I'll disable it for now and remove mentions about it in NEWS and README.

Cheers,
Quentin.
_______________________________________________
Etoile-dev mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-dev

Reply via email to