stdio line-streaming revisited

Andrei Alexandrescu (See Website For Email) SeeWebsiteForEmail at erdani.org
Thu Mar 29 14:39:23 PDT 2007


kris wrote:
> Andrei Alexandrescu (See Website For Email) wrote:
>> After a summary read I saw this:
>>
>> classRef.method1().method2().method3();
>>
>> In this case, indeed the three methods are evaluated in sequence. It 
>> would be, however, a mistake to infer from that that the code:
>>
>> Cout("Hello, ")(Cin.get);
>>
>> guaranteedly reads the console before having printed "Hello, ". It 
>> doesn't.
> 
> Nobody claimed that it "guaranteedly" (whatever that means) does in the 
> general case, so let's please move on?
> 
> The only thing asserted is that call-chaining is evaluated in 
> left-to-right order. I think we can safely put that back to bed again

You wrote this:

-----------------------
There used to be a tango/example like this variation:

     import tango.io.Console;

     void main()
     {
         Cout ("Please enter your name: ").flush;
         Cout ("Hello, ") (Cin.get);
     }
-----------------------

The code is incorrect. Point blank. Right?


Andrei



More information about the Digitalmars-d mailing list