www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - File IO: C# streams VS iterators?

reply "DDD" <dcb854d0bfb1 f98b7c56a69c.anonbox.net> writes:


Walter said he thinks iterators (unless I remember wrong) is 
superior. The speaker agreed but said it isn't a drop in 
replacement so that is an issue if you want to port.

I haven't access file in D and i'm completely confused. What are 
iterators in regards to file IO?
Nov 07 2013
next sibling parent reply Lionello Lunesu <lionello lunesu.remove.com> writes:
On 11/8/13, 8:57, DDD wrote:


 thinks iterators (unless I remember wrong) is superior. The speaker
 agreed but said it isn't a drop in replacement so that is an issue if
 you want to port.

 I haven't access file in D and i'm completely confused. What are
 iterators in regards to file IO?
There are several ranges that can be used for file IO, for example such capability, which is why you have TextReader and TextWriter on top of streams, etc.. However, sometimes it's useful to have polymorphism for accessing would be pretty trivial to port the base classes to D and implement them using the D ranges. L.
Nov 07 2013
parent Jacob Carlborg <doob me.com> writes:
On 2013-11-08 04:22, Lionello Lunesu wrote:

 However, sometimes it's useful to have polymorphism for accessing

 would be pretty trivial to port the base classes to D and implement them
 using the D ranges.
For that, there's Tango: https://github.com/SiegeLord/Tango-D2 http://www.dsource.org/projects/tango/docs/current/ -- /Jacob Carlborg
Nov 07 2013
prev sibling parent Jacob Carlborg <doob me.com> writes:
On 2013-11-08 01:57, DDD wrote:


 thinks iterators (unless I remember wrong) is superior. The speaker
 agreed but said it isn't a drop in replacement so that is an issue if
 you want to port.

 I haven't access file in D and i'm completely confused. What are
 iterators in regards to file IO?
he must have said ranges. A range is like a pair of iterators. It's heavily used in D. -- /Jacob Carlborg
Nov 07 2013