January 20, 2013
Am 20.01.2013 19:58, schrieb Era Scarecrow:
> On Sunday, 20 January 2013 at 18:10:47 UTC, Walter Bright wrote:
>> On 1/20/2013 1:15 AM, Russel Winder wrote:
>>> Thanks in advance for any input. Attribution of sources if
>>> appropriate will be given unless people prefer anonymity!
>> SFINAE vs static if
>   Substitution failure is not an error. Wasn't that where if the
> template use/instantiation failed it would go onto the next one (and
> hope one of them worked)? Although it could work assuming you have
> enough templates to handle the cases, being able to determine if they
> quality (as in D) is a superior solution.
>   Reminds me... Wasn't there a problem with the min/max in C++ where to
> correctly make it work there was some 90+ templates for the STL? (I
> think it was rejected). Makes you wonder sometimes what they are
> thinking when they decide this stuff.

I do miss using a language like C++ on my daily job, but then I read articles about "great ideas" like SFINAE.

January 21, 2013
Concurrency and parallelism may be emphasized well with this simple example:

    foreach(i, ref elem; task_pool.parallel(logs)) {
        elem = log(i + 1.0);

Keeping the (straight forward) serial semantics, we write parallelizable code.

Another good example, that demonstrates concurrency model borrowed from Erlang is:

    while (cont) {
            (int msg) { writeln("int received: ", msg) },
            (string msg) {
                cont = (msg == "stop") ? false : true;

The 'send' part you can easily add by yourself.

Both examples emphasize requiring little and giving much.
Next ›   Last »
1 2
Top | Discussion index | About this forum | D home