On 10/12/07, Bob Cronin <[EMAIL PROTECTED]> wrote: > some of my pipelines are wondrous to behold, at least to me ;-). Oh, and if > what you say were strictly the case, would we really have a SPACE stage? > Wasn't that done to make it easier to accomplish something that could be > accomplished with a similar set of somewhat-less-obvious stages? Where/how > do you draw the line?
After 15 years of plumbing, I believe that I think my algorithms in Pipes (or data flow model) even when I don't implement it as a pipeline. Writing a sequential program is often harder for me to do. So I do understand that I'm not the best person to judge whether some idiom is easy to grasp. But I think that once you master multi-stream pipelines, the learning is incremental. If you invest part of the time you saved using Pipes in learning about it, things tend to move pretty fast. It looks like many plumbers master juxtapose, but never used predselect. That may be because the common reason for destructive testing (anycase) been built in all stages now. But it's a pity because predselect is very elegant. I am also a big fan of parcel (even though some of that is now in deblock). All I can do is show examples and present about Pipes (when they let me). It's the Piper who draws the line. I cannot read his mind, but some of the things that seem to play a role in that process are: #1 he needs it himself and does not want to carry around a rexx stage to do it #2 It appears to be a common thing and fairly easy to do without messing things up #3 it can be generalized to do way more than what was asked for #4 Melinda convinced him to do it #5 I asked for it, and it's close to x-mas or my birthday #6 its on the list of 50 requirements he got for his 50th birthday And I admit that #4 and #5 do overlap a bit with #6. But there's many things I have asked for that never happened. To build the space function in a generic way is a bit hairy because you cannot assume there's an unused code position you can use as end-of-line. You could probably do the basic REXX space() function with half a dozen stages. But with the generalization that the space stage has now (pad with strings, and using a set of delimiters) is pretty powerful and can do many more things (I tend to use space to remove delimiters from my record, like with "space 0 anyof /:-./" ) I am not sure how locating words in a record could be generalized. In many cases, you would need also the position of the word rather than just knowing the word is somewhere in the record. And would it be enough to have the 1st occurrence or would you want all of them. So maybe a stage that will output a record with the column positions (or words?). But what words would you want to find? If you must specify it as an argument, that is very restrictive. But if it reads the words via a secondary input, then you get very close to what lookup does now... Rob
