Friday, June 25, 2010

Functions are coming

I've implemented an experimental function call expression syntax. This is coming in Version 1.0.7 (ETA by July).

See
http://www.xmlsh.org/SyntaxFunction

For some documentation on how this will work.

Considering also adding dynamic type coercion so that variables interact with xquery expressions in a more obvious way.

E.g.

a=1
echo <[ $a + 1 ]>

Fails because $a is a xs:string type.
You need to do

a=<[1]>
echo <[ $a + 1 ]>

to get an integer

I'm considering having expressions passed to xquery or perhaps when evaluated to automatically be coerced to the apparent type, but I haven't worked out all the ramifications of this yet.