October 24, 2014
On Friday, 24 October 2014 at 17:08:00 UTC, Max Samukha wrote:

> Apparently, D doesn't allow type variables in value parameters at all.

Nor does it allow passing delegates to value parameters, only alias parameters.

October 24, 2014
On Friday, 24 October 2014 at 16:12:48 UTC, ketmar via Digitalmars-d-learn wrote:
> On Fri, 24 Oct 2014 16:00:41 +0000
> via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com> wrote:
>
>> On Friday, 24 October 2014 at 14:06:08 UTC, ketmar via Digitalmars-d-learn wrote:
>> > On Thu, 23 Oct 2014 18:28:04 +0000
>> > Max Samukha via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com>
>> > wrote:
>> >
>> > um-hm... maybe this:
>> >
>> >   void Foo(T, U) (T delegate (U) a) {
>> >     // here T is bool, U is int for the following sample
>> >     import std.stdio;
>> >     writeln(a(3));
>> >   }
>> >
>> >   Foo((int x) => x%2 == 0);
>> 
>> I thought the same thing, but it doesn't compile with DMD from Git:
> Foo is a function, not declaration. put in in main(), for example:
>
>   void main () { Foo((int x) => x%2 == 0); }

Now I'm feeling really stupid :-P
1 2
Next ›   Last »