Hi,
I cannot make the following compile.
import std.functional;
import std.array;
import std.algorithm;
import std.stdio;
void main() {
auto numbers = [0, 1, 2, 3, 4, 5];
bool alwaysTrue(uint a) { return true; }
alias not!(alwaysTrue) alwaysFalse;
numbers = array(filter!(always
On 1/19/11 5:53 PM, Jens Mueller wrote:
Hi,
I cannot make the following compile.
import std.functional;
import std.array;
import std.algorithm;
import std.stdio;
void main() {
auto numbers = [0, 1, 2, 3, 4, 5];
bool alwaysTrue(uint a) { return true; }
alias not!(alwaysTrue) alw
Andrei Alexandrescu wrote:
> On 1/19/11 5:53 PM, Jens Mueller wrote:
> >Hi,
> >
> >I cannot make the following compile.
> >
> >import std.functional;
> >import std.array;
> >import std.algorithm;
> >import std.stdio;
> >
> >void main() {
> > auto numbers = [0, 1, 2, 3, 4, 5];
> >
> > bool a
On 1/19/11 7:19 PM, Jens Mueller wrote:
Andrei Alexandrescu wrote:
On 1/19/11 5:53 PM, Jens Mueller wrote:
Hi,
I cannot make the following compile.
import std.functional;
import std.array;
import std.algorithm;
import std.stdio;
void main() {
auto numbers = [0, 1, 2, 3, 4, 5];
boo
On 01/20/2011 02:19 AM, Jens Mueller wrote:
Thanks. Can you elaborate a bit please? I wonder why the alias won't
work.
Because in your original version the alias line does not define a func,
but a kind of constant symbol. A higher order func like filter expects a
func as first arg, not a cons
Andrei Alexandrescu wrote:
> On 1/19/11 7:19 PM, Jens Mueller wrote:
> >Andrei Alexandrescu wrote:
> >>Place the call to not!alwaysTrue in a local function inside main:
> >>
> >> bool alwaysFalse(uint a) { return not!alwaysTrue(a); }
> >
> >Thanks. Can you elaborate a bit please? I wonder why t
On 1/20/11 12:47 PM, Jens Mueller wrote:
Andrei Alexandrescu wrote:
On 1/19/11 7:19 PM, Jens Mueller wrote:
Andrei Alexandrescu wrote:
Place the call to not!alwaysTrue in a local function inside main:
bool alwaysFalse(uint a) { return not!alwaysTrue(a); }
Thanks. Can you elaborate a bi
Andrei Alexandrescu wrote:
> On 1/20/11 12:47 PM, Jens Mueller wrote:
> >Andrei Alexandrescu wrote:
> >>On 1/19/11 7:19 PM, Jens Mueller wrote:
> >>>Andrei Alexandrescu wrote:
> Place the call to not!alwaysTrue in a local function inside main:
>
> bool alwaysFalse(uint a) { return