Hi all

Here how I call a function recursively


declare %private function local:test( $i, $recursiveFunction) { 
        if ( $i > 0)  
        then ($i, $recursiveFunction( $i - 1, $recursiveFunction)) 
        else() 
} ;

local:test( 10, local:test#2)



Always
Leo




> On 8 Oct 2020, at 14:17, Rob Stapper <r.stap...@lijbrandt.nl> wrote:
> 
> Hi,
>  
> The code[1] below and send as attachment generates a error message: “Static 
> variable depends on itself: $Q{http://www.w3.org/2005/xquery-local-functions 
> <http://www.w3.org/2005/xquery-local-functions>}test”.
> I use these variables to refer to my private functions in my modules so I can 
> easyly refer to them in a inheritance situation. 
> It’s not a big problem for me but I was wondering if the error-triggering is 
> justified or that it should work. 
>  
> [1]===========================================
> declare variable $local:test := local:test#1 ;
> declare %private function local:test( $i) { if ( $i > 0)  then $local:test( 
> $i - 1) } ;
>  
> $local:test( 10)
> ===========================================
>  
> Kind regards,
>  
> Rob Stapper
>  
>  
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
>  
> 
>  
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient&utm_term=icon>
>       Virus-free. www.avast.com 
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient&utm_term=link>
>  <x-msg://1/#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2><test.xq>

Reply via email to