Feedback on Streams concept, similar to Ranges

Monkyyy crazymonkyyy at gmail.com
Wed May 17 13:47:15 UTC 2023


On Wednesday, 17 May 2023 at 08:29:38 UTC, Andrew wrote:
> On Wednesday, 17 May 2023 at 00:50:19 UTC, Monkyyy wrote:
>> How would this help me with say rendering video and enforcing 
>> frames are syncef? If T[] doesnt have any flexable logic?
>
> I'm not really sure how you think that an IO stream library 
> would help you particularly more than any other one would... 
> that said, it would certainly be easier to enforce that frames 
> are synced using this library than, say, Phobos ranges, because 
> you can more gracefully handle stream errors without having to 
> use exceptions/GC stuff.
>
> Additionally, like Sergey suggested, I've added "buffered" 
> streams, as decorators for any base stream, so that you could, 
> for example, use a buffered input stream to read exactly as 
> many bytes from a video stream as needed to fill a framebuffer 
> (or something like that, I'm not familiar with video stuff).
For ranges I could use `takeExactly` and store the range 
somewhere to have the frame syncing enforcment; that sort of 
thing comes from just duck typing templates so you can build up 
your concept.
By having your primitive be [] rather then a list of functions to 
match, airnt you reducing the expressiveness if actaully adopted 
with a liberty of algorthims?




More information about the Digitalmars-d mailing list