stdio line-streaming revisited

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


jcc7 wrote:
> == Quote from kris (foo at bar.com)'s article
>> jcc7 wrote:
>>> == Quote from kris (foo at bar.com)'s article
>>>
>>>> Frits van Bommel wrote:
>>>> [snip]
>>>>
>>>>> What I'm trying to say here is basically this: you shouldn't rely on the
>>>>> order of evaluation of parameters. Not even if one of them happens to be
>>>>> used as 'this' for the method in question.
>>>> Absolutely agree. Yet, without wishing to go off on a tangent, we're
>>>> talking about call-chaining and not parameter evaluation-order. These
>>>> are different things, and there was a painfully long thread on exactly
>>>> this subject a year or two ago.
>>>> Walter closed that one by stating call-chaining can only realistically
>>>> evaluate from left to right (or something to that effect) and that's
>>>> what D does.
>>>> I'm sure JCC could locate that thread in a heartbeat ... don't know > how he
>>> does that, but he sure is effective at it :)
>>>
>>> These days, I Usually just use Google and restrict it to www.digitalmars.com (such
>>> as the search box on the Digital Mars webpage does).
>>>
>>> I can't seem to track down this one though. My technique works best when I
>>> actually remember the particular post or discussion (and it works really well when
>>> I remember that I myself posted in the discussion). And I don't really remember
>>> this discussion.
>>>
>>> Do you happen to remember who Walter was replying to? That could be helpful. I
>>> can't seem to find the right keywords to find the particular topic. I tried
>>> various combinations of "newshound" (Walter's e-mail), "evaluation", "order",
>>> "operator", "operation", "call", "chain", "return", "function", etc. Also,
>>> sometimes it's helpful if I know when the discussion took place (Last month? Last
>>> year? 2005?). But this might just be a needle that remains hidden in the haystack.
>>>
>>> Perhaps we can just talk Walter into putting this principle in the D
> Specification. ;)
>>> jcc7
>> If I recall correctly, it started off as a complaint about the use
>> of call-chaining in Mango, and resulted in someone leaving the NG
>> for good (was his name manfred or something?)
> 
> I think this is what you're looking for:
> http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D&artnum=31264
> or
> http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=31264

The information is not there.

> It's part of a much larger discussion:
> http://www.digitalmars.com/d/archives/digitalmars/D/31069.html#N31264

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.


Andrei



More information about the Digitalmars-d mailing list