Objects on message queues of spawned processes

Timon Gehr timon.gehr at gmx.ch
Thu Apr 19 09:06:43 PDT 2012


On 04/19/2012 10:09 AM, Russel Winder wrote:
> On Wed, 2012-04-18 at 15:04 -0700, Ali Çehreli wrote:
> [...]
>> The workaround is to name the parameter:
>>
>>       receive((S s) {});
>
> OK, this works for me as well, which is great. The question now is
> whether this is a feature or a bug?  In terms of the parameter list of a
> function literal, the names should be there so requiring the name is
> fixing a bug that was there. In terms of usability in context, if the
> programmer doesn't use the variable just the fact that an instance of
> the type was received, then having to give the variable a name is total
> noise. In this case the old behaviour was right and the change created a
> new bug.
>
> I guess this is a situation where "Walter Decides" ?
>

The issue is that the meaning of (S) {} in non-template delegate 
signatures has changed: Previously it was a delegate with an unnamed 
parameter of type 'S', now it is a delegate with a parameter named 'S' 
of a deduced type. I think that the second meaning is more useful and 
more consistent, but YMMV. (You can name the parameter '_' or something 
along those lines to express that it is not used.)


More information about the Digitalmars-d mailing list