stdio line-streaming revisited

kris foo at bar.com
Wed Mar 28 23:48:28 PDT 2007


Bill Baxter wrote:
> kris wrote:
> 
>> Andrei Alexandrescu (See Website For Email) wrote:
> 
> 
>> - Tango is for D programmers; not C programmers.
> 
> 
> D programmers sometimes like to call 3rd party code written in other 
> languages, and pretty much any interop in D has to happen via C 
> compatibility.  E.g. pyD.  So I'm guessing if my D code calls on some 
> Python code that prints to the console that somewhere down the line that 
> eventually ends up on C's stdout.  I could be wrong, but at least that's 
> why I *think* Andrei and Walter keep saying that C compatibility is 
> important.
> 
> Andrei -- by "compatibility" does that mean if I rebind stdio/stdout to 
> something different that both D and C's output go to the new place?  Or 
> is it still necessary to rebind them individually?  I did this once for 
> some legacy code in C++, and found that I had to rebind 3 things: the C 
> streams, the C++ old-style streams from <iostream.h> (was under MSVC 6), 
> and the new-style C++ streams from <iostream>.    And then I had to do 
> the interleaving myself, which didn't really work (because all the 
> streams were just writing to output buffers individually).  If what 
> you're talking about with compatibility would avoid that kind mess, that 
> is certainly be a good thing.
> 
> --bb

That post noted the feasibility of hooking C into tango.io, which is a 
potentially realistic option



More information about the Digitalmars-d mailing list