early alpha of D REPL

John Colvin john.loughran.colvin at gmail.com
Fri Feb 14 03:58:41 PST 2014


On Friday, 14 February 2014 at 05:32:12 UTC, Asman01 wrote:
> On Tuesday, 11 February 2014 at 04:46:41 UTC, Martin Nowak 
> wrote:
>> Barely running but already fun and a little useful.
>>
>> Example:
>>
>> D> import std.algorithm, std.array, std.file;
>> => std
>> D> auto name(T)(T t) {
>> |     return t.name;
>> | }
>> => name
>> D> dirEntries(".", SpanMode.depth).map!name.join(", ")
>> => ./drepl_sandbox
>> D>
>>
>> https://github.com/MartinNowak/drepl
>> http://drepl.dawg.eu/
>
> Very nice! thanks. I tried the following code but it print 
> nothing:
>
> auto twice = (int a) => 2*a;
> twice(2);
>
> What's wrong with that?

Drop the semicolon after twice(2)


More information about the Digitalmars-d-announce mailing list