Bob Cronin wrote:
> Since I am so far mystified by the warp stuff, perhaps you could give
> a simple example showing how it would be used
Now that I've looked at it: It's basically a shorthand for a big
FANOUT|FANINANY|FANOUT|FANIN mess. In a single pipeline spec, it will
let you move whole pipelines around without having to reattach the
primary output of FANINANY each time:
(end /) warp A | outpipe / inpipe1 | warp A / inpipe2 | warp A
(end /) inpipe1 | warp A / warp A | outpipe / inpipe2 | warp A
(end /) inpipe2 | warp A / inpipe1 | warp A / warp A | outpipe
But the magical part is that you can direct output of a subroutine
pipeline to a previously established warp, instead of having to
ADDSTREAM an extra stage and connect to it:
'addpipe warp A |' outpipe
'addpipe' inpipe1 '| warp A'
'callpipe (end /)' inpipe2 '| warp A /' inpipe3 '| warp A'
You could even create a convention with default destinations for
specially named outputs that the main pipeline set can capture and
redirect:
/* a WARPSTATE command would have made this even more convenient */
'callpipe warplist | pick 1-* == "ERROR" | count lines | var ewarp'
If ewarp = 0 then /* calling pipeline didn't set */
'addpipe warp ERROR | cons' /* so default to console */
'callpipe var message | warp ERROR'
¬R