On 04/04/2015 06:24 PM, Holger Hans Peter Freyther wrote: > On Sat, Apr 04, 2015 at 02:50:01AM +0200, Roland Plüss wrote: > > Oh, > >> gst_eval_code( "SystemExceptions.InvalidArgument new signal" ); >> >> But this causes the VM to call abort since an exception happened outside >> the bytecode. I assume you need to be more clever in this case. So what >> is the correct way to throw these kinds of exceptions from inside a C >> function? > Oh I don't know. The signal should occur once is out of C. E.g. > you should be able to return an instance of InvalidArgument and > in the Smalltalk code that triggered the C call-out check for the > response and then signal it? > I don't know. I tried an example like this:
C++: => gst_perform( something ) Smalltalk: something[] => do a cCall (let's say cc) C++: => cc: thrown exception using gst_eval_code( "SystemExceptions.InvalidArgument new signal" ); Now let's say I try to catch the exception in Smalltalk. If I'm not wrong it would look something like this: something [ [ anObject aCCallThatThrows ] on: Exception do: [ 'a test' printNl ] ] But the exception is not handled but abort called by the byte code. Could it be it fails because I'm using gst_perform? -- Mit freundlichen Grüssen Plüss Roland Leader und Head Programmer - Game: Epsylon ( http://www.indiedb.com/games/epsylon ) - Game Engine: Drag[en]gine ( http://www.indiedb.com/engines/dragengine , http://dragengine.rptd.ch/wiki ) - Normal Map Generator: DENormGen ( http://epsylon.rptd.ch/denormgen.php ) - Sowie verschiedene Blender Export-Skripts und Game-Tools
signature.asc
Description: OpenPGP digital signature
_______________________________________________ help-smalltalk mailing list help-smalltalk@gnu.org https://lists.gnu.org/mailman/listinfo/help-smalltalk