my ideas for array operations

Daniel Keep daniel.keep.lists at gmail.com
Sat Oct 6 05:14:54 PDT 2007



dennis luehring wrote:
>> These constructs are much more general, and more powerful.  And they can
>> be implemented as library code right now.
> 
> and you will use them instead of writing you own foreachs?
> and if not, why?

At the moment I don't because tuples got introduced and I didn't get
around to updating my functional library.  That's because I got
side-tracked by futures, which got side-tracked by thread pools which
got stalled, and then I was doing other stuff...

That said, a better example is my Python code; I frequently use
functional constructs where I can, since it tends to make the code a
hell of a lot simpler.

One other thing I realised from your examples: even if you don't like
functional coding, your first three could be solved neatly by adding
.sum, .product and .join pseudo-member functions (of which I think .join
already exists).  The trick is then to find more examples that aren't
contrived.  :P

So yes, I would use such constructs.  I just need to get around to
updating them with tuples and automatic threading.

	-- Daniel



More information about the Digitalmars-d mailing list