Revision [1378]

Last edited on 2010-05-11 06:11:45 by DavePawson
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
Deletions:
y=$x #y is now a list
To call a function with x as a parameter, use


Revision [1377]

Edited on 2010-05-11 06:10:17 by DavePawson
Additions:
given a sequence in $x
Deletions:
given a seq in $x


Revision [1376]

Edited on 2010-05-11 05:56:05 by DavePawson
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.
Deletions:
These are lists of items which might be strings for instance. Created with the '(' ... ')' notation. For example
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.
Deletions:
=====Plain lists=====


Revision [1369]

The oldest known version of this page was created on 2010-05-10 02:20:57 by DavePawson [Added note about passing seq parameter]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki