Does D have too many features?

David Nadlinger see at klickverbot.at
Sun Apr 29 10:03:52 PDT 2012


On Sunday, 29 April 2012 at 16:10:40 UTC, Jacob Carlborg wrote:
> On 2012-04-29 17:07, David Nadlinger wrote:
>> On Sunday, 29 April 2012 at 14:40:38 UTC, Jacob Carlborg wrote:
>>> foreach ([1, 2, 3, 4] ; i) {
>>> writeln(i);
>>> }
>>
>> We'd still need a solution for continue and break, though.
>>
>> David
>
> This has already been solved when using opApply, although quite 
> an ugly solution.

Yes, but that requires the compiler to generate the return value 
»glue« code for continue/break inside an opApply foreach. If 
foreach is a library function and you pass an ordinary delegate, 
you have a problem in the current language since you can't know 
that a »return« statement inside that delegate really should 
return from the outer function.

David


More information about the Digitalmars-d mailing list