Re: Deprecation: module std.stream is deprecated

2015-11-10 Thread Spacen Jasset via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 11:57:03 UTC, Jonathan M Davis wrote: ... building blocks rather than kitchen sinks. And most range-based ... I still can't really see why byChunk and byLine are part of the File API? Especially byLine, I'll get byChunk go for now. I think what I am trying

Re: Deprecation: module std.stream is deprecated

2015-11-10 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, November 08, 2015 14:41:05 Spacen Jasset via Digitalmars-d-learn wrote: > This looks the simplest solution at the moment: > > >> auto inputRange = File(__FILE__).byChunk(1024).joiner; > >> Foo foo = Foo(inputRange); > > But it doesn't seem efficient and strays off the

Re: Deprecation: module std.stream is deprecated

2015-11-08 Thread Spacen Jasset via Digitalmars-d-learn
On Sunday, 8 November 2015 at 08:29:30 UTC, BBaz wrote: On Sunday, 8 November 2015 at 08:21:38 UTC, BBaz wrote: On Saturday, 7 November 2015 at 13:52:29 UTC, Spacen Jasset wrote: [...] I have a used a template, because I cannot directly use the InputRange(char) interface as a type, and auto

Re: Deprecation: module std.stream is deprecated

2015-11-08 Thread BBasile via Digitalmars-d-learn
On Sunday, 8 November 2015 at 14:41:11 UTC, Spacen Jasset wrote: But it doesn't seem efficient and strays off the conceptual path. In other words, why chunk things up, join them back, to get a stream? `.byChunk` caches and `.joiner` hides this caching mechanism. Both operations happen under

Re: Deprecation: module std.stream is deprecated

2015-11-08 Thread BBaz via Digitalmars-d-learn
On Saturday, 7 November 2015 at 13:52:29 UTC, Spacen Jasset wrote: [...] I have a used a template, because I cannot directly use the InputRange(char) interface as a type, and auto won't work either, so is there another parameter type I can use, such that I can have the concept of an abstract

Re: Deprecation: module std.stream is deprecated

2015-11-08 Thread BBaz via Digitalmars-d-learn
On Sunday, 8 November 2015 at 08:21:38 UTC, BBaz wrote: On Saturday, 7 November 2015 at 13:52:29 UTC, Spacen Jasset wrote: [...] I have a used a template, because I cannot directly use the InputRange(char) interface as a type, and auto won't work either, so is there another parameter type I

Re: Deprecation: module std.stream is deprecated

2015-11-07 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, November 07, 2015 12:10:05 Spacen Jasset via Digitalmars-d-learn wrote: > Deprecation: module std.stream is deprecated - It will be removed > from Phobos in October 2016. > > The std.stream module documentation doesn't give any clues as to > what an alternative might

Re: Deprecation: module std.stream is deprecated

2015-11-07 Thread Spacen Jasset via Digitalmars-d-learn
On Saturday, 7 November 2015 at 13:30:44 UTC, Jonathan M Davis wrote: On Saturday, November 07, 2015 12:10:05 Spacen Jasset via Digitalmars-d-learn wrote: Deprecation: module std.stream is deprecated - It will be removed from Phobos in October 2016. The std.stream module documentation doesn't

Deprecation: module std.stream is deprecated

2015-11-07 Thread Spacen Jasset via Digitalmars-d-learn
Deprecation: module std.stream is deprecated - It will be removed from Phobos in October 2016. The std.stream module documentation doesn't give any clues as to what an alternative might be. I have this sort of code: this(InputStream input) { int

Re: Deprecation: module std.stream is deprecated

2015-11-07 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, November 07, 2015 13:52:26 Spacen Jasset via Digitalmars-d-learn wrote: > Thanks Jonathan. I don't quite see what I want to do though. > > In order to abstract the file aspect of things away, and deal > with a stream of chars that could be from a file, or some some > other source