setjmp / longjmp

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Apr 25 22:56:46 PDT 2015


On Sat, 25 Apr 2015 23:25:13 +0000, Cassio Butrico wrote:

> Hello everyone , first congratulations for the wonderful forum , I wish
> someone could help me , I am writing a small basic interpreter in D and
> I am with some difficulties.
> 
> estoutentando manupular the setjmp / longjmp buffers , but the error , I
> use windows 7 and the dmd 2067 , will be whose manipulate the buffers
> save and return ? Excuse my english sucks.

you shouldn't use setjmp/longjmp in D. use exceptions instead. something 
like this:

instead of setjmp:
try {
  doit
} catch (MyException e) {
  process e
}

and instead of longjmp:
throw new MyException();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20150426/47f8bc22/attachment.sig>


More information about the Digitalmars-d-learn mailing list