stdio line-streaming revisited

Andrei Alexandrescu (See Website For Email) SeeWebsiteForEmail at erdani.org
Thu Mar 29 10:58:52 PDT 2007


Frits van Bommel wrote:
> Andrei Alexandrescu (See Website For Email) wrote:
>> Sean Kelly wrote:
>>> Andrei Alexandrescu (See Website For Email) wrote:
>>>> Bill Baxter wrote:
>>>>>
>>>>> I believe the current discussion is only about under-the-hood 
>>>>> implementation issues.  So I don't think you have to worry about 
>>>>> any D libraries exposing (good or bad) C/C++ design decisions to 
>>>>> users.  Tango is going to expose the same D interface no matter how 
>>>>> it's implemented under the hood.
>>>>
>>>> That's great, however the interface has a problem too: it does not 
>>>> produce atomic strings in multithreaded programs.
>>>
>>> Which interface?  And are you talking about input or output?
>>
>> Cout. The thing is that the design using the syntax Cout(a)(b) is 
>> conducive to two separate calls to the library. I recall this has been 
>> briefly discussed here.
> 
> Of course that could easily be fixed if either struct destructors or 
> scope class returning were to be added to the language. Then you could 
> just return something with a destructor that releases the lock.

Struct destructors will be added, but typesafe variadics are already in. 
I think Cout(a, b) is the most natural interface to offer.


Andrei



More information about the Digitalmars-d mailing list