D component programming is a joke (Was: Re: Component programming)

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Aug 2 09:40:58 PDT 2013


On Fri, Aug 02, 2013 at 04:06:46PM +0000, Justin Whear wrote:
> On Thu, 01 Aug 2013 22:24:32 -0700, H. S. Teoh wrote:
> > Now, w.r.t. the roadblocks I alluded to.
> > 
> > When I first started working on the code, my goal was to maximize
> > usage of existing Phobos facilities in order to show how many
> > batteries D already comes with. As it turned out, I could only use
> > basic Phobos components; some of the more complex pieces like
> > frontTransversal, which would've been perfect for the bit that
> > splices formatted month lines together, couldn't be used because it
> > wasn't flexible enough to handle the insertion of fillers when some
> > subranges are empty. In the end, I had to code that range by hand,
> > and I can't say I'm that happy with it yet.
> 
> I recently wrote a range component for my current project that is
> similar but with a twist.  It takes a bunch of ranges, each of which
> is assumed to be sorted with some predicate, then it walks through
> them, returning a range of the fronts of each range. The twist is that
> it has to call a user-supplied `produce` function whenever it
> encounters a mismatch (e.g.  a range's front is greater than the
> others or a range is empty).

It would be nice to collect these custom ranges and see if there's some
common functionality that can be added to Phobos.


T

-- 
The trouble with TCP jokes is that it's like hearing the same joke over and over.


More information about the Digitalmars-d mailing list