string-ish range/stream from curl ubyte[] chunks?

Vlad via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri May 16 15:36:02 PDT 2014


On Friday, 16 May 2014 at 21:35:04 UTC, Steven Schveighoffer 
wrote:
> On Fri, 16 May 2014 16:57:41 -0400, Vlad <b100dian at gmail.com> 
> wrote:
>
>>
>> Q: Is anything like this already in use somewhere in the 
>> standard library or a project you know?
>
> There is an effort by myself and Dmitry Olshansky to create a 
> stream API that looks like a range. I am way behind on getting 
> it to work, but I have something that compiles.
>
> The effort is to replace the underlying mechanism for std.stdio 
> (optionally), and to replace std.stream
>
>> Q2: Or do you have any pointers for what the smallest API 
>> would be for a string-like range class?
>
> I think Dmitry has a pretty good API. I will hopefully be 
> posting my prototype soon. I hate to say wait for it, because I 
> have been very lousy at getting things finished lately. But I 
> want to have something to show before the conference.
>
> The code I have will support all encodings, and provide a range 
> API that works with dchar-like ranges. The idea is to be able 
> to make code that works with both arrays and streams seamlessly.
>
>> And bonus:
>> Q3: any uses of such a string-ish range in other standard 
>> library methods that you can think of and could be contributed 
>> to? e.g. suppose this doesn't exist and I / we come up with a 
>> proposal of minimal API to consume a string from left to right.
>
> I hate for you to duplicate efforts, hold off until we get 
> something workable. Then we can discuss the API.
>
> Dmitry's message is here: 
> http://forum.dlang.org/post/l9q66g$2he3$1@digitalmars.com
>
> My updates have not been posted yet to github, I don't want to 
> post half-baked code yet. Stay tuned.
>
> -Steve

Thanks Steve for your prompt reply. This is exactly why I asked 
on the forums, since it was hard for me to believe I was the only 
one thinking of this.

I would also hate to duplicate the effort, so I'll just code my 
parser against string and wait to see how your proposal and 
Dimitry's (I did checked his post, and sounds EXACTLY like the 
problem I was facing with my toy parser!).

Just to make one thing clear: would this future module work with 
e.g. the ubyte[] chunks I receive from curl?

Thanks!

p.s.
Is this the talk? http://dconf.org/2014/talks/olshansky.html



More information about the Digitalmars-d-learn mailing list