lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Quoting Egor Skriptunoff <egor.skriptunoff@gmail.com>:

b = Buffer(1024)
s1 = b:Segment(128, 256) -- from 128 to 384
s1 = b:Segment(128):size(256) -- from 128 to 384
s1 = b:Segment(128):to(384) -- from 128 to 384
s2 = b:Segment(439)      -- from 439 to 1024
s3 = b:Segment()      -- from 0 to 1024
s4 = b:Segment():size(128)      -- from 0 to 128
s5 = b:Segment(128):to(384):next() -- from 384 to 640
s5 = b:Segment(128):to(384):shift(10) -- from 138 to 394

Thank you guys. not providing b:Segment() is a big oversight on my part.
All this is great input and gave me a lot to think about.  I'll have some
refactoring to do ...

-Tobias