[xquery-talk] XQuery 3 function cast assignment

John Snelson John.Snelson at marklogic.com
Fri Feb 10 01:32:02 PST 2012


This returns true:

local:cat#2 instance of function(xs:string, xs:string) as xs:string

However there are many function types that local:cat#2 matches.

John

On 9 Feb 2012, at 23:50, David Lee wrote:

> I'm learning the exciting world of xquery3 function items.
> I'd like to tightly type an assignment but can't quite get the syntax.
>  
> Should this work ?
>  
> ---------------
> declare function local:cat( $a as xs:string , $b as xs:string ) as xs:string {
>     concat($a,$b)
>     };
>  
> let $animal as xs:string := "Cat" ,
>     $func as function( ) as xs:string := local:cat#2  (: HERE - how to type $func ? :)
>     return $func("bad " , $animal )
>  
>  
> Thanks for any suggestions




More information about the talk mailing list