On Wednesday, 29 May 2013 at 07:32:53 UTC, Walter Bright wrote:
On 5/29/2013 12:02 AM, Russel Winder wrote:
On Tue, 2013-05-28 at 22:33 -0700, Walter Bright wrote:
[…]

You just need to get the component programming religion! and get away from using FILE*. There isn't anything fundamentally different from using a fake FILE* and using a template with a different InputRange. If that's still unacceptable, you can create an InputRange that is a class with virtual functions empty(), front(), and popFront(), then use derived classes for the File or string.

One of the things that made me a fan of OO, was when I understood
the types of file manipulations that were possible with the IO abstractions
available in most languages in comparison with was is possible in
a pure procedural world.

Sure iostreams, Java IO, .NET, Smalltalk might offer complex IO models, but they are quite powerful for doing generic code over abstract data sources.

--
Paulo

Reply via email to