From: David Alan Black Date: 2000-12-14T11:13:51+09:00 Subject: [ruby-talk:7186] Re: "map_with_indices" and related musings Hello -- On Wed, 13 Dec 2000, Conrad Schneiker wrote: > David Alan Black writes, [Whoops -- sorry about the screwy margins in the original.] > # I wonder whether there's some unifying, underlying Thing that all > # these problems we're solving are mutually doing. If so, what > # exactly is that Thing (interleaving with self's indices?) and can > # the cluster of methods we've been talking about (interleaving, > # to_hashing, etc.) be factored and constructed, as a group, to > # reflect that unity? > Well, you might call that Thing "generalized parallel vector > processing".These sorts of things are reminiscent of the increasingly > complex sorts of pipeline vector operations seen on some ancient > generations of supercomputers. Which in turn is (among other things) a > low-dimensional slice of generalized parallel array processing. > > Which is reminiscent of the "APL view of reality", whose (sort of) > successor is J: Interesting -- and I'll have a look at it -- but I may be putting things more abstractly than I mean. Or maybe the thing I'm groping toward is more abstract than I think.... but let me try to frame it more as a Ruby-centric question. In (semi-)practical terms: if one would like to have a robust, expandable little library of array-manipulation methods (interleave, to_h, ...), what would be the best starting point -- literally, The Method in terms of which The Next Method would be defined, and so on? Is it just a question of benchmarking? (Well, yes, ultimately it probably is.) Or is there some way to factor out the most basic functionality, and proceed from there? As opposed to, say, just collecting methods like butterflies as they happen to flit by. Still a bit abstract, I guess. Partly I'm fascinated by the way arrays become awfully hash-like when you let them include their indices in the iteration.... which seems to have implications for what can/should be defined in terms of what. (I fear I may just be taking us back to the to_h discussion of a few weeks ago.) David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav