On Monday, 18 June 2018 at 12:48:46 UTC, Steven Schveighoffer
wrote:
On 6/17/18 11:58 PM, Neia Neutuladh wrote:
[...]
Yep, it's a good point. But also not the only way to do this.
If you are returning void, just a goto would work:
[...]
I'm quite a noob when it comes to compiler stuff,
On 6/17/18 11:58 PM, Neia Neutuladh wrote:
On Sunday, 17 June 2018 at 10:58:29 UTC, Cauterite wrote:
Is there a reason scope(success) needs to set up for exception handling?
Or is this a bug / potential enhancement ?
If you had no exception handling in place, you'd need to duplicate code
in
On Monday, 18 June 2018 at 03:58:47 UTC, Neia Neutuladh wrote:
...
yeah, at an AST level it makes sense why it was implemented like
this.
it's unfortunate that there's no straightforward way to express
'finally(success) {'.
On Sunday, 17 June 2018 at 10:58:29 UTC, Cauterite wrote:
Is there a reason scope(success) needs to set up for exception
handling?
Or is this a bug / potential enhancement ?
If you had no exception handling in place, you'd need to
duplicate code in the output. For instance:
void foo()
{
On Sunday, 17 June 2018 at 10:58:29 UTC, Cauterite wrote:
---
// main.d
void main() {
scope(success) {}
}
dmd -betterC main.d
Error: Cannot use try-catch statements with -betterC
---
You can see what the compiler is doing at
https://run.dlang.io/is/5BZOQV and clicking on the
On 6/17/18 8:24 AM, Timoses wrote:
On Sunday, 17 June 2018 at 10:58:29 UTC, Cauterite wrote:
Hello,
I'm not sure whether I'm missing something obvious here, but is there
a reason for scope(success) being lowered to a try-catch statement?
I would have expected only scope(exit) and
On Sunday, 17 June 2018 at 12:10:33 UTC, Nicholas Wilson wrote:
I suspect scope(success) is lowered because scope(exit) and
scope(failure)
are, and that would result in a simpler (compiler)
implementation of it.
does adding nothrow to main fix it? For dcompute I specifically
allow
On 6/17/18 6:58 AM, Cauterite wrote:
Hello,
I'm not sure whether I'm missing something obvious here, but is there a
reason for scope(success) being lowered to a try-catch statement?
I would have expected only scope(exit) and scope(failure) to actually
interact with exception handling, while
On Sunday, 17 June 2018 at 10:58:29 UTC, Cauterite wrote:
Hello,
I'm not sure whether I'm missing something obvious here, but is
there a reason for scope(success) being lowered to a try-catch
statement?
I would have expected only scope(exit) and scope(failure) to
actually interact with
On Sunday, 17 June 2018 at 10:58:29 UTC, Cauterite wrote:
Hello,
I'm not sure whether I'm missing something obvious here, but is
there a reason for scope(success) being lowered to a try-catch
statement?
I would have expected only scope(exit) and scope(failure) to
actually interact with
Hello,
I'm not sure whether I'm missing something obvious here, but is
there a reason for scope(success) being lowered to a try-catch
statement?
I would have expected only scope(exit) and scope(failure) to
actually interact with exception handling, while scope(success)
simply places code on
11 matches
Mail list logo