Re: Catching C errors

2022-10-20 Thread data pulverizer via Digitalmars-d-learn
On Thursday, 20 October 2022 at 13:02:52 UTC, bachmeier wrote: I've done an initial release of the second version: https://github.com/bachmeil/embedrv2 The two biggest changes are - Moving to Dub as the default for compilation, which allows the use of any other Dub libraries - It writes the

Re: Catching C errors

2022-10-20 Thread data pulverizer via Digitalmars-d-learn
On Thursday, 20 October 2022 at 12:14:38 UTC, jmh530 wrote: On Thursday, 20 October 2022 at 11:59:45 UTC, data pulverizer wrote: [snip] Mine is also private for now till it reaches an acceptable state when I'll think about whether it should be publicly released or jealously guarded. It's a pro

Re: Catching C errors

2022-10-20 Thread bachmeier via Digitalmars-d-learn
On Thursday, 20 October 2022 at 10:13:41 UTC, Sergey wrote: On Thursday, 20 October 2022 at 09:52:05 UTC, data pulverizer wrote: I'm currently writing a D interop with R, the dynamic statistical programming language. There's a function called How is your project related to EmbedR? The descrip

Re: Catching C errors

2022-10-20 Thread jmh530 via Digitalmars-d-learn
On Thursday, 20 October 2022 at 11:59:45 UTC, data pulverizer wrote: [snip] Mine is also private for now till it reaches an acceptable state when I'll think about whether it should be publicly released or jealously guarded. It's a project I'm building for my own use really. It can't hurt to

Re: Catching C errors

2022-10-20 Thread data pulverizer via Digitalmars-d-learn
On Thursday, 20 October 2022 at 10:13:41 UTC, Sergey wrote: On Thursday, 20 October 2022 at 09:52:05 UTC, data pulverizer wrote: I'm currently writing a D interop with R, the dynamic statistical programming language. There's a function called How is your project related to EmbedR? The descrip

Re: Catching C errors

2022-10-20 Thread Sergey via Digitalmars-d-learn
On Thursday, 20 October 2022 at 09:52:05 UTC, data pulverizer wrote: I'm currently writing a D interop with R, the dynamic statistical programming language. There's a function called How is your project related to EmbedR? The description of the project could be found here: https://dlang.org/b

Re: Catching C errors

2022-10-20 Thread data pulverizer via Digitalmars-d-learn
On Wednesday, 19 October 2022 at 16:48:10 UTC, Ali Çehreli wrote: On 10/19/22 07:05, data pulverizer wrote: > I am calling code from a C API, and would like to know how to catch exit > errors If you are talking about the exit() Posix function, you can't do anything about that because its purpo

Re: Catching C errors

2022-10-19 Thread ryuukk_ via Digitalmars-d-learn
On Wednesday, 19 October 2022 at 16:47:49 UTC, data pulverizer wrote: On Wednesday, 19 October 2022 at 14:05:35 UTC, data pulverizer wrote: Hi all, I am calling code from a C API, and would like to know how to catch exit errors so that they can be handled and make them more like an exceptions

Re: Catching C errors

2022-10-19 Thread Ali Çehreli via Digitalmars-d-learn
On 10/19/22 09:47, data pulverizer wrote: > It's okay, I've found a work around. Do you simply check the return value? Ali

Re: Catching C errors

2022-10-19 Thread Ali Çehreli via Digitalmars-d-learn
On 10/19/22 07:05, data pulverizer wrote: > I am calling code from a C API, and would like to know how to catch exit > errors If you are talking about the exit() Posix function, you can't do anything about that because its purpose is to cause "normal process termination". Ali

Re: Catching C errors

2022-10-19 Thread data pulverizer via Digitalmars-d-learn
On Wednesday, 19 October 2022 at 14:05:35 UTC, data pulverizer wrote: Hi all, I am calling code from a C API, and would like to know how to catch exit errors so that they can be handled and make them more like an exceptions so that the computation can continue. I've tried something similar to

Catching C errors

2022-10-19 Thread data pulverizer via Digitalmars-d-learn
Hi all, I am calling code from a C API, and would like to know how to catch exit errors so that they can be handled and make them more like an exceptions so that the computation can continue. I've tried something similar to what is outlined here: https://dlang.org/phobos/object.html#.Error bu