On Wednesday, 25 August 2021 at 15:30:57 UTC, Steven
Schveighoffer wrote:
[...]
Another approach is to let the compiler deal with the error
handling and not muddy your return type. Swift does something
similar, where it rewrites the throw/catch into a standard
return and doesn't do actual thr
On 8/25/21 10:58 AM, WebFreak001 wrote:
Hm I'm not quite seeing how the error handler is related to an "Expected
type interface" that the compiler could expect.
This would be without compiler changes.
Currently with exceptions the scope things are implemented using
try-catch-finally, this
On Wednesday, 25 August 2021 at 14:42:07 UTC, Steven
Schveighoffer wrote:
I think it's possible to work with some mechanics that aren't
necessarily desirable. Something like:
```d
ErrorHandler error = registerErrorHandler;
error.onFailure({writeln("division failed");});
error.onSuccess({write
On Wednesday, 25 August 2021 at 14:52:34 UTC, Steven
Schveighoffer wrote:
On 8/25/21 10:42 AM, Steven Schveighoffer wrote:
I think it's possible to work with some mechanics that aren't
necessarily desirable. Something like:
One has to weigh how much this is preferred to actual exception
On Wednesday, 25 August 2021 at 14:42:07 UTC, Steven
Schveighoffer wrote:
On 8/25/21 10:22 AM, Paul Backus wrote:
On Wednesday, 25 August 2021 at 14:04:54 UTC, WebFreak001
wrote:
[...]
Probably the only principled way to make this work would be to
define some kind of "concept"/structural int
On 8/25/21 10:42 AM, Steven Schveighoffer wrote:
I think it's possible to work with some mechanics that aren't
necessarily desirable. Something like:
One has to weigh how much this is preferred to actual exception handling...
If something like DIP1008 could become usable, it might allevia
On 8/25/21 10:22 AM, Paul Backus wrote:
On Wednesday, 25 August 2021 at 14:04:54 UTC, WebFreak001 wrote:
Would it be possible to extend `scope(exit)` and `scope(success)` to
trigger properly for functions returning `Expected!T` as defined in
the [expectations](https://code.dlang.org/packages/ex
On Wednesday, 25 August 2021 at 14:22:26 UTC, Paul Backus wrote:
On Wednesday, 25 August 2021 at 14:04:54 UTC, WebFreak001 wrote:
[...]
Probably the only principled way to make this work would be to
define some kind of "concept"/structural interface that's
recognized by the compiler to mean
On Wednesday, 25 August 2021 at 14:04:54 UTC, WebFreak001 wrote:
Would it be possible to extend `scope(exit)` and
`scope(success)` to trigger properly for functions returning
`Expected!T` as defined in the
[expectations](https://code.dlang.org/packages/expectations)
and [expected](https://code
Would it be possible to extend `scope(exit)` and `scope(success)`
to trigger properly for functions returning `Expected!T` as
defined in the
[expectations](https://code.dlang.org/packages/expectations) and
[expected](https://code.dlang.org/packages/expected) DUB
libraries?
For example is it
10 matches
Mail list logo