Thread overview
Re: [phobos] Broken DMD Download Link
Aug 16, 2012
Daniel Murphy
Aug 16, 2012
David Nadlinger
Aug 16, 2012
David Nadlinger
August 16, 2012
+Phobos

Anyone has an insight into what's happening?


Thanks,

Andrei

On 8/16/12 1:08 PM, Chuck Allison wrote:
> I hate to do this to you Andrei, but I just installed 2.060 and some
> code broke - using std.concurrency.receive. I checked the doc and it
> does't look like anything changed. It says it can't instantiate the
> receive template for the following, which looks like what is currently
> in the dove:
>
> while (nprod > 0) {
> receive(
> (int n) {queue.push_back(n);},
> (Signal) {--nprod;},
> (Tid tid) {tid.send(queue.pop_front());}
> );
> }
>
> Fails on the first delegate above. Was there a major change in
> std.concurrency?
>
> Here's the error:
>
> prodcons.d(27): Error: template std.concurrency.receive does not match
> any function template declaration
> /usr/share/dmd/src/phobos/std/concurrency.d(542): Error: template
> std.concurrency.receive(T...) cannot deduce template function from
> argument types !()(void delegate(int n) @system,void,void delegate(Tid
> tid) @system) prodcons.d(58): Error: template std.concurrency.receive
> does not match any function template declaration
> /usr/share/dmd/src/phobos/std/concurrency.d(542): Error: template
> std.concurrency.receive(T...) cannot deduce template function from
> argument types !()(void delegate(int n) @system,void)
>
> -- Chuck
>
> On Aug 16, 2012, at 10:26 AM, Andrei Alexandrescu wrote:
>
>> Just uploaded the installer, apologies for this blunder.
>>
>> Andrei
>>
>> On 8/15/12 1:48 PM, Charles Allison wrote:
>>> Hello Gentlemen:
>>>
>>> I thought you'd like to now that the link for downloading the OS X
>>> installer for 2.060 at http://dlang.org/download.html is broken! I
>>> really prefer the dmg installer over unzipping and tweaking the
>>> environment, which I'll do if I have to.
>>>
>>> -- Chuck
>
_______________________________________________
phobos mailing list
phobos@puremagic.com
http://lists.puremagic.com/mailman/listinfo/phobos

August 17, 2012
Guess:
>> (Signal) {--nprod;},
should be
>> (Signal sig) {--nprod;},


On Fri, Aug 17, 2012 at 3:15 AM, Andrei Alexandrescu <andrei@erdani.com> wrote:
> +Phobos
>
> Anyone has an insight into what's happening?
>
>
> Thanks,
>
> Andrei
>
> On 8/16/12 1:08 PM, Chuck Allison wrote:
>>
>> I hate to do this to you Andrei, but I just installed 2.060 and some code broke - using std.concurrency.receive. I checked the doc and it does't look like anything changed. It says it can't instantiate the receive template for the following, which looks like what is currently in the dove:
>>
>> while (nprod > 0) {
>> receive(
>> (int n) {queue.push_back(n);},
>> (Signal) {--nprod;},
>> (Tid tid) {tid.send(queue.pop_front());}
>> );
>> }
>>
>> Fails on the first delegate above. Was there a major change in std.concurrency?
>>
>> Here's the error:
>>
>> prodcons.d(27): Error: template std.concurrency.receive does not match
>> any function template declaration
>> /usr/share/dmd/src/phobos/std/concurrency.d(542): Error: template
>> std.concurrency.receive(T...) cannot deduce template function from
>> argument types !()(void delegate(int n) @system,void,void delegate(Tid
>> tid) @system) prodcons.d(58): Error: template std.concurrency.receive
>> does not match any function template declaration
>> /usr/share/dmd/src/phobos/std/concurrency.d(542): Error: template
>> std.concurrency.receive(T...) cannot deduce template function from
>> argument types !()(void delegate(int n) @system,void)
>>
>> -- Chuck
>>
>> On Aug 16, 2012, at 10:26 AM, Andrei Alexandrescu wrote:
>>
>>> Just uploaded the installer, apologies for this blunder.
>>>
>>> Andrei
>>>
>>> On 8/15/12 1:48 PM, Charles Allison wrote:
>>>>
>>>> Hello Gentlemen:
>>>>
>>>> I thought you'd like to now that the link for downloading the OS X installer for 2.060 at http://dlang.org/download.html is broken! I really prefer the dmg installer over unzipping and tweaking the environment, which I'll do if I have to.
>>>>
>>>> -- Chuck
>>
>>
> _______________________________________________
> phobos mailing list
> phobos@puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
_______________________________________________
phobos mailing list
phobos@puremagic.com
http://lists.puremagic.com/mailman/listinfo/phobos

August 16, 2012
On 16 Aug 2012, at 19:15, Andrei Alexandrescu wrote:
> Anyone has an insight into what's happening?
>
> On 8/16/12 1:08 PM, Chuck Allison wrote:
>> receive(
>> (int n) {queue.push_back(n);},
>> (Signal) {--nprod;},
>> (Tid tid) {tid.send(queue.pop_front());}
>> );
>> }

The problem probably is that (Signal) {} doesn't do what you might think – it declares a delegate literal with one parameter named Signal (of unspecified type), instead of a delegate with a nameless parameter of type Signal.

I don't know off-hand why this worked in 2.059 – maybe a more precise template constraint was added to receive().

David
_______________________________________________
phobos mailing list
phobos@puremagic.com
http://lists.puremagic.com/mailman/listinfo/phobos
August 16, 2012
On 16 Aug 2012, at 20:40, Chuck Allison wrote:
> Actually, I was still on 2.057. Confusing declarator requirement, I must say.

Yes, it's a somewhat unfortunate quirk in the syntax – I've also been bitten by it in the past in a similar situation – but badly necessary to allow short specification of (the equivalent of) template functions e.g. as parameters to higher order functions. We also have the »=>« notation now, but not every delegate consists of a single expression.

> Is there anyway to indicate an unnamed parameter, so I don't need a useless parameter name?

A convention I found useful is to use a single underscore, but technically that's just an arbitrary valid identifier.

> Are omissions of unused parameters no longer allowed in general, or just in some instances?

No, function/delegate literals are the only place where this rules are in effect.

David
_______________________________________________
phobos mailing list
phobos@puremagic.com
http://lists.puremagic.com/mailman/listinfo/phobos