[Tidbit] making your D code more modular & unittestable

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Wed Mar 8 16:31:22 PST 2017


On Thu, Mar 09, 2017 at 12:21:48AM +0000, Adam D. Ruppe via Digitalmars-d wrote:
> On Wednesday, 8 March 2017 at 21:34:19 UTC, H. S. Teoh wrote:
> > So I came up with an idea to abstract file contents as a
> > random-access range of ubyte with lazy loading, so that I can
> > rewrite file parsing code in the nice
> 
> Sounds like what the kernel does when you memory-map a file...

I know... I probably should've just used std.mmfile.

But it was fun to write my own RA range with slicing.  I did learn a
thing or two about what std.range considers to satisfy hasSlicing... it
wasn't quite as obvious as I had thought.


T

-- 
"I suspect the best way to deal with procrastination is to put off the procrastination itself until later. I've been meaning to try this, but haven't gotten around to it yet. " -- swr


More information about the Digitalmars-d mailing list