[Issue 18759] feature request: blocks

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 13 14:56:49 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=18759

Simen Kjaeraas <simen.kjaras at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simen.kjaras at gmail.com

--- Comment #1 from Simen Kjaeraas <simen.kjaras at gmail.com> ---
I'd suggest posting this on the forum. You're gonna have to write a DIP for it
to actually be added to the language.

This definitely needs more detail about the behavior of 'break', 'continue' and
'return' - constructs that don't make sense in all possible use cases. There
should be a way to declare which of these are valid.

I'd also like to see more complete examples. While your 'indefinitely' example
is great, it does not show how to deal with arguments - multiple input,
multiple output, inference. For instance, what would myFoo look like in a case
like this:

myFoo (ref e, out int n, float f; a, b) {
    if (f < 1) continue;
    n = e * f;
    e++;
    if (f > 2) break;
    if (e == 14) return;
}

(feel free to use a completely different example, this is just to highlight the
different complications possible)

--


More information about the Digitalmars-d-bugs mailing list