Piping
Piping
Section titled “Piping”In an action list, ;| separates two commands like ; does, and pipes the first into the second: what the first command shows you is passed to the second instead, which reads it as %|. Spaces may come between the ; and the |.
To try a list at the prompt, run it with @force/noeval me={...}. Without /noeval, @force evaluates the list once before running it, while %| is still empty.
> @force/noeval me={think [ansi(hr,Hello)] there ;| @pemit me=Got [words(%|)] words: %|}Got 2 words: Hello there%| holds every line the piped command showed you, joined with %r, colors and other markup kept. stripansi() removes the markup; there is no terminal code to translate.
> @force/noeval me={@dolist/inline red green=think ##;| think Colors: [edit(%|,%r,%b-%b)]}Colors: red - green- Only what is shown to the object running the list is piped. Messages to anyone else are delivered as usual.
- Only the command right after
;|reads it. Every other command reads an empty%|. Pipes chain: ina ;| b ;| c,breads whatashowed andcwhatbshowed. - Work the piped command queues (
@wait, a queued@switch) runs later and is shown as usual. A list queued by the command after;|gets a copy of%|, the way it gets a copy of the q-registers. - The text is cut at the last whole line that fits the output limit.
%| is what a command showed. %> is what it returned: see command output.
PennMUSH has neither: it reads %| as a plain |, and runs ;| as ; followed by a command starting with |, which is no command there either.
::: seealso