Additions:
y=$x
$y is now a list
To call another script or a function with x as a parameter, where you want to retain the parameter as a sequence use
$y is now a list
To call another script or a function with x as a parameter, where you want to retain the parameter as a sequence use
Deletions:
To call a function with x as a parameter, use
Additions:
given a sequence in $x
Deletions:
Additions:
Note that 'lists' are really sequences according to the XDM model, but don't let that put you off.
These are lists of items [sequences ] which might be strings for instance. Created with the '(' ... ')' notation. For example
To access the command line parameters from a script, as, say 'xmlsh scriptname a.xml b.xml c.xml
parms=$*
() creates a sequence {} preserves one when calling a function, another script or even calling an initial script.
These are lists of items [sequences ] which might be strings for instance. Created with the '(' ... ')' notation. For example
To access the command line parameters from a script, as, say 'xmlsh scriptname a.xml b.xml c.xml
parms=$*
() creates a sequence {} preserves one when calling a function, another script or even calling an initial script.
Deletions:
or to access the command line parameters from a script, as, say 'xmlsh scriptname a.xml b.xml c.xml
parms=$@
() creates a sequence {} preserves one
Revision [1375]
Edited on 2010-05-11 05:51:20 by DavePawson [Added note about passing seq parameter]Additions:
=====Plain sequences=====
===Using variables holding sequences===
The rule is
() creates a sequence {} preserves one
given a seq in $x
x=(a b c)
y=$x #y is now a list
To call a function with x as a parameter, use
functname param1 param2 {$x} is the required syntax
which ensures that the function receives, and can process $x as a sequence.
===Using variables holding sequences===
The rule is
() creates a sequence {} preserves one
given a seq in $x
x=(a b c)
y=$x #y is now a list
To call a function with x as a parameter, use
functname param1 param2 {$x} is the required syntax
which ensures that the function receives, and can process $x as a sequence.