June 06, 2008
Jarrett Billingsley wrote:
> "SodiumFree" <bob@pistachios.com> wrote in message news:g2c3e2$2v9h$1@digitalmars.com...
>> Thanks, both examples make the explanation a lot clearer. Rather strange that something like this has made it into the book though.
> 
> It's probably because Tango is not complete, and has been in a constant state of flux for the past year and a half since it was announced.  When that chapter of the book was written, that probably was the interface to Cin.readln. 

I know it's in alpha, but I really wish the Tango devs (and Phobos, too) would put more thought into backwards compatibility. Even if it's just a deprecated function to forward to the new API, I'd rather it be there to allow old programs to compile. </complaining about something I didn't pay for or help with>
June 09, 2008
"Jarrett Billingsley" wrote
> "SodiumFree" <bob@pistachios.com> wrote in message news:g2c3e2$2v9h$1@digitalmars.com...
>> Thanks, both examples make the explanation a lot clearer. Rather strange that something like this has made it into the book though.
>
> It's probably because Tango is not complete, and has been in a constant state of flux for the past year and a half since it was announced.  When that chapter of the book was written, that probably was the interface to Cin.readln.

I don't have a copy of the book, but I think it is just a book typo. According to this changeset: http://www.dsource.org/projects/tango/changeset/2094

readln always had the current interface since it was introduced.  What the book should have done was used copyln (or get):

void main(){
    Cout("What is your name? ").flush;
    auto name = Cin.copyln; // or Cin.get
    Cout("Hello ")(name).newline;
}

-Steve


1 2
Next ›   Last »