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.

1 comment:

  1. This new syntax was released in 1.0.7

    To verify that your script is running in a supporting version I suggest using

    require 1.0.7

    ReplyDelete

Due to comment spam, moderation is turned on. I will approve all non-spam comments.