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%7Dtest%E2%80%9D. 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 for Windows 10
Hi Rob, sorry, I’ve just discovered your mail in the basex-talk archive. I believe that the given query should not raise an error as the variable does only reference your function. Let’s see what we can do. – Best, Christian
On Thu, Oct 8, 2020 at 2:17 PM Rob Stapper r.stapper@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%7Dtest%E2%80%9D.
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 <#m_1823454217451684430_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
---------- Oorspronkelijk Bericht ---------- Van: Rob Stapper <r.stapper@lijbrandt.nl> Aan: Christian Grün <christian.gruen@gmail.com> Datum: 19-10-2020 10:01 Onderwerp: RE: [basex-talk] recursively used variables Good Morning Christian, Yes, I was wondering if you had received my mail. This time lapse is so not like you. Thanx for having a look. It would be great if this worked, implementing inheritance-like structures would be so much more transparent. Have a look at the attachment if you like. Recursion here does not work and a work-around would brake down the systematic approach. Best, Rob Sent from Mail https://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10 From: Christian Grün mailto:christian.gruen@gmail.com Sent: Sunday, October 18, 2020 4:08 PM To: Rob Stapper mailto:r.stapper@lijbrandt.nl Cc: basex-talk@mailman.uni-konstanz.de mailto:basex-talk@mailman.uni-konstanz.de Subject: Re: [basex-talk] recursively used variables Hi Rob, sorry, I’ve just discovered your mail in the basex-talk archive. I believe that the given query should not raise an error as the variable does only reference your function. Let’s see what we can do. – Best, Christian On Thu, Oct 8, 2020 at 2:17 PM Rob Stapper <r.stapper@lijbrandt.nl mailto:r.stapper@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}test http://www.w3.org/2005/xquery-local-functions%7Dtest ”. 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 >
mvgr.
Rob Stapper
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.stapper@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>
… or a xPath function in a variable
declare %private variable $recursiveFunction:= function( $i, $recursiveFunction) { if ( $i > 0) then ($i, $recursiveFunction( $i - 1, $recursiveFunction)) else() } ;
$recursiveFunction( 10, $recursiveFunction)
On 8 Oct 2020, at 14:17, Rob Stapper <r.stapper@lijbrandt.nl mailto:r.stapper@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>
I noticed there is an open issue that relates to your observation:
https://github.com/BaseXdb/basex/issues/1095
Lots to do right now, let’s see when we can tackle it.
On Thu, Oct 8, 2020 at 2:17 PM Rob Stapper r.stapper@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%7Dtest%E2%80%9D.
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 <#m_9175477539326496683_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
Hi Rob, hi all,
We’ve recently added some ancient bugs regarding self dependencies in variable declarations [1,2]. BaseX 11.2 will be out soon.
Best, Christian
[1] https://github.com/BaseXdb/basex/issues/1095 [2] https://files.basex.org/releases/latest/
On Thu, Oct 8, 2020 at 2:17 PM Rob Stapper r.stapper@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%7Dtest%E2%80%9D.
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 <#m_-3413609695658352816_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
Yes 😄😄😄.Might make me try again to port my application to version 11.I'm still using 10.7Cheers, Rob.Verzonden vanaf mijn Galaxy -------- Oorspronkelijk bericht --------Van: Christian Grün christian.gruen@gmail.com Datum: 12-08-2024 16:29 (GMT+01:00) Aan: Rob Stapper r.stapper@lijbrandt.nl Cc: basex-talk@mailman.uni-konstanz.de Onderwerp: Re: [basex-talk] recursively used variables Hi Rob, hi all,We’ve recently added some ancient bugs regarding self dependencies in variable declarations [1,2]. BaseX 11.2 will be out soon.Best,Christian[1] https://github.com/BaseXdb/basex/issues/1095%5B2%5D%C2%A0https://files.basex... Thu, Oct 8, 2020 at 2:17 PM Rob Stapper r.stapper@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%7Dtest%E2%80%9D.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 for Windows 10
Virus-free. www.avast.com
basex-talk@mailman.uni-konstanz.de