Experiments with emscripten and D

Daniel Murphy yebblies at nospamgmail.com
Sun Aug 18 20:10:23 PDT 2013


"H. S. Teoh" <hsteoh at quickfur.ath.cx> wrote in message 
news:mailman.186.1376878962.1719.digitalmars-d at puremagic.com...
> On Sun, Aug 18, 2013 at 06:52:14AM +0200, deadalnix wrote:
> [...]
>> I feel pretty confident I can do a wat speech for D.
> [...]
>
> Please do, I'm curious to hear it. :)
>

import std.algorithm : filter, map;

void main()
{
    foreach(c; map!"a"("hello")) // Identity map function
        static assert(c.sizeof == 4); // Passes

    foreach(c; filter!"true"("hello")) // Pass-all filter
        static assert(c.sizeof == 4); // Passes

    foreach(c; "hello")
        static assert(c.sizeof == 4); // Fails
}


WAT.




More information about the Digitalmars-d mailing list