DIP 57: static foreach

krzaq via Digitalmars-d digitalmars-d at puremagic.com
Wed Nov 4 03:53:59 PST 2015


On Wednesday, 4 November 2015 at 11:41:59 UTC, Idan Arye wrote:
> On Tuesday, 3 November 2015 at 20:28:43 UTC, Andrei 
> Alexandrescu wrote:
>> On 11/03/2015 03:12 PM, Shammah Chancellor wrote:
>>>>
>>>
>>> Ditto.  This needs `static continue` and `static break`.  
>>> Without this
>>> functionality, the control flow in `static foreach` becomes 
>>> very unwieldy.
>>
>> "continue" and "break" (no static) should just work. -- Andrei
>
> Depending on what you want `continue` and `break` to do. 
> Consider this: http://dpaste.dzfl.pl/925e4aec6173
>
> Note that the pragma gets compiled for `true` even though we 
> `continue` before it. This is the expected behavior from 
> `continue`, but a `static continue` should have skipped that, 
> and a static break should have skipped the compilation of the 
> rest of the AliasSeq.

 From a D newbie's point of view this is very far from the 
expected behaviour.


More information about the Digitalmars-d mailing list