Changeset 40433 in project


Ignore:
Timestamp:
09/07/21 21:24:40 (3 weeks ago)
Author:
lassik
Message:

Explain scsh-process splicing syntax in detail

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/scsh-process

    r38695 r40433  
    119119</enscript>
    120120
    121 The arguments to a {{<program>}} rule are implicitly quasiquoted.  The
    122 basic building blocks are {{<program>}} and {{<begin>}}, which always
    123 correspond to one process in a pipeline.  The other rules are ways to
    124 combine these two.
     121The basic building blocks are {{<program>}} and {{<begin>}}, which
     122always correspond to one process in a pipeline. The other rules are
     123ways to combine these two.
     124
     125{{<program>}} gives the name of a program to run. If it starts with a
     126slash, it's an absolute filename. If it contains a slash but doesn't
     127start with one, it's a relative filename. If it doesn't contain a
     128slash, it's a command name that is located in {{PATH}}. One or more
     129{{<arg>}}s can be given as arguments to the program.
     130
     131{{<program>}} and each {{<arg>}} are implicitly quasiquoted.
     132{{<program>}} can be a string, symbol, number, or an {{unquote}}
     133expression {{,e}} that evaluates to a value of one of those types.
     134Each {{<arg>}} follows the same rules as {{<program>}}, but can
     135additionally be an {{unquote-splicing}} expression {{,@e}} that
     136evaluates to a list of multiple arguments where each element is a
     137string, symbol, or number.
     138
     139NOTE: An {{unquote-splicing}} expression is not recognized in
     140{{<program>}} position, so it's not possible to obtain {{<program>}}
     141and {{<arg>}}s from the same {{,@}} expression. If you have both the
     142program name and the arguments in the same list, use {{car}} and
     143{{cdr}} to destructure the list before passing it to {{run}}.
    125144
    126145The {{pipe}} rule will hook up standard output and standard error of
Note: See TracChangeset for help on using the changeset viewer.