[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: API Design
- From: tobias@...
- Date: Tue, 19 Sep 2017 01:05:33 +0200
Quoting Russell Haley <email@example.com>:
b:Segment() - I would think this would be 0 to the length of the buffer.
I like the :next() and :shift() ideas, but that would mean the module
would need internal state on what the size of the 'chuck' would be?
cs = 256
s4 = b:Segment(128,cs):next(cs)
or if state IS desired:
b.def_chuck_size = 256
s4 = b:Segment(128):next()
State is not an issue, the instances are already stateful. I'm going
ahead with Egors ideas :-)