[xquery-talk] incorrect syntax?

Andrew Welch andrew.j.welch at gmail.com
Tue Oct 2 01:38:30 PDT 2012


On 2 October 2012 09:30, David Carlisle <davidc at nag.co.uk> wrote:
> On 02/10/2012 08:56, Andrew Welch wrote:
>>
>> ha that's great (if a little contrived):
>>
>> declare default function namespace "x";
>> declare function return ($x) { $x+1 };
>> return (23)
>>
>> returns 24
>
>
> Yes that is contrived, I think it's clearer if you write it like this
>
> declare default function namespace "return";
> declare variable $return := 23;
> declare function return ($return) { $return+1 };
> return ($return)

That is indeed much clearer, thanks David.


;)


-- 
Andrew Welch
http://andrewjwelch.com


More information about the talk mailing list