inspect functions and %private

Monday, 2 December 2013 · 6 messages · last reply 6 Dec 2013
JM
jean-marc Mercier2 Dec 2013 10:41 #
Hi, To report a small issue in the inspect functions module with %private declaration. The following code runs perfectly :
declare %private function local:test(){()};
for $fun in inspect:functions() return "gotcha"
However, If the function test is located in another module, say test, then the following code import module namespace test="http://www.example.com/test" at test.xq";
for $fun in inspect:functions() return "gotcha"
raise an exception. Cheers, Jean-Marc
CG
Christian Grün2 Dec 2013 12:43 #
Quoted text · jean-marc Mercier · 8 lines
> However, If the function test is located in another module, say test, then > the following code > > import module namespace test="http://www.example.com/test" at test.xq"; > > for $fun in inspect:functions() return "gotcha" > > raise an exception.
If you mean the exception "Function 'test:test' is not visible from this module.", that’s how it should be. If you mean another exception, could you please provide us with an SSCCE? Christian
JM
jean-marc Mercier2 Dec 2013 13:18 #
Hi christian, yes this is the point : Stopped at C:/Jiheme/informatique/workspace/Graph DataBase/module/common.xq, 31/89: [XPST0017] Function 'local:test' is not visible from this module. If this is desired, it means that we can not use the inspection module as soon as there is %private annotation in any imported module. Maybe an alternative behavior for the inspection module could be to ignore %private functions ? 2013/12/2 Christian Grün <christian.gruen at gmail.com>
Quoted text · Christian Grün · 16 lines
> > However, If the function test is located in another module, say test, > then > > the following code > > > > import module namespace test="http://www.example.com/test" at test.xq"; > > > > for $fun in inspect:functions() return "gotcha" > > > > raise an exception. > > If you mean the exception "Function 'test:test' is not visible from > this module.", that’s how it should be. If you mean another exception, > could you please provide us with an SSCCE? > > Christian >
CG
Christian Grün5 Dec 2013 19:35 #
Hi Jean-Marc, thanks for the report. Leo has just fixed the issue. Feel free to check out the new snapshot [1]. Christian [1] http://files.basex.org/releases/latest/
Quoted text · jean-marc Mercier · 35 lines
On Mon, Dec 2, 2013 at 1:18 PM, jean-marc Mercier <jeanmarc.mercier at gmail.com> wrote: > Hi christian, yes this is the point : > > Stopped at C:/Jiheme/informatique/workspace/Graph DataBase/module/common.xq, > 31/89: > [XPST0017] Function 'local:test' is not visible from this module. > > If this is desired, it means that we can not use the inspection module as > soon as there is %private annotation in any imported module. > > Maybe an alternative behavior for the inspection module could be to ignore > %private functions ? > > > > 2013/12/2 Christian Grün <christian.gruen at gmail.com> >> >> > However, If the function test is located in another module, say test, >> > then >> > the following code >> > >> > import module namespace test="http://www.example.com/test" at test.xq"; >> > >> > for $fun in inspect:functions() return "gotcha" >> > >> > raise an exception. >> >> If you mean the exception "Function 'test:test' is not visible from >> this module.", that’s how it should be. If you mean another exception, >> could you please provide us with an SSCCE? >> >> Christian > >
JM
jean-marc Mercier6 Dec 2013 12:10 #
Christian, Hello. I just tested the new snapshot. There might still be a small issue there (maybe there's nothing you can do and we have to careful), since I can now execute %private functions : I have a module where there is a %private function.
module namespace common = 'http://www.example.com/common';
declare %private function common:test(){"test"};
Then I switch to a my main project and tries
for $fun in inspect:functions() where fn:data(inspect:function($fun)/@name)
= "common:test" return $fun()
and it returns "test" Cheers, Jean-Marc 2013/12/5 Christian Grün <christian.gruen at gmail.com>
Quoted text · Christian Grün · 49 lines
> Hi Jean-Marc, > > thanks for the report. Leo has just fixed the issue. Feel free to > check out the new snapshot [1]. > > Christian > > [1] http://files.basex.org/releases/latest/ > ___________________________ > > On Mon, Dec 2, 2013 at 1:18 PM, jean-marc Mercier > <jeanmarc.mercier at gmail.com> wrote: > > Hi christian, yes this is the point : > > > > Stopped at C:/Jiheme/informatique/workspace/Graph > DataBase/module/common.xq, > > 31/89: > > [XPST0017] Function 'local:test' is not visible from this module. > > > > If this is desired, it means that we can not use the inspection module as > > soon as there is %private annotation in any imported module. > > > > Maybe an alternative behavior for the inspection module could be to > ignore > > %private functions ? > > > > > > > > 2013/12/2 Christian Grün <christian.gruen at gmail.com> > >> > >> > However, If the function test is located in another module, say test, > >> > then > >> > the following code > >> > > >> > import module namespace test="http://www.example.com/test" at > test.xq"; > >> > > >> > for $fun in inspect:functions() return "gotcha" > >> > > >> > raise an exception. > >> > >> If you mean the exception "Function 'test:test' is not visible from > >> this module.", that’s how it should be. If you mean another exception, > >> could you please provide us with an SSCCE? > >> > >> Christian > > > > >
CG
Christian Grün6 Dec 2013 12:28 #
Quoted text · jean-marc Mercier · 3 lines
> I just tested the new snapshot. There might still be a small issue there > (maybe there's nothing you can do and we have to careful), since I can now > execute %private functions :
…that’s indeed possible now. We may tackle this in a future version. Thanks for testing, Christian
Quoted text · jean-marc Mercier · 77 lines
> I have a module where there is a %private function. > > module namespace common = 'http://www.example.com/common'; > declare %private function common:test(){"test"}; > > Then I switch to a my main project and tries > > for $fun in inspect:functions() where fn:data(inspect:function($fun)/@name) > = "common:test" return $fun() > > and it returns "test" > > Cheers, > > Jean-Marc > > > > > > > > > > 2013/12/5 Christian Grün <christian.gruen at gmail.com> >> >> Hi Jean-Marc, >> >> thanks for the report. Leo has just fixed the issue. Feel free to >> check out the new snapshot [1]. >> >> Christian >> >> [1] http://files.basex.org/releases/latest/ >> ___________________________ >> >> On Mon, Dec 2, 2013 at 1:18 PM, jean-marc Mercier >> <jeanmarc.mercier at gmail.com> wrote: >> > Hi christian, yes this is the point : >> > >> > Stopped at C:/Jiheme/informatique/workspace/Graph >> > DataBase/module/common.xq, >> > 31/89: >> > [XPST0017] Function 'local:test' is not visible from this module. >> > >> > If this is desired, it means that we can not use the inspection module >> > as >> > soon as there is %private annotation in any imported module. >> > >> > Maybe an alternative behavior for the inspection module could be to >> > ignore >> > %private functions ? >> > >> > >> > >> > 2013/12/2 Christian Grün <christian.gruen at gmail.com> >> >> >> >> > However, If the function test is located in another module, say test, >> >> > then >> >> > the following code >> >> > >> >> > import module namespace test="http://www.example.com/test" at >> >> > test.xq"; >> >> > >> >> > for $fun in inspect:functions() return "gotcha" >> >> > >> >> > raise an exception. >> >> >> >> If you mean the exception "Function 'test:test' is not visible from >> >> this module.", that’s how it should be. If you mean another exception, >> >> could you please provide us with an SSCCE? >> >> >> >> Christian >> > >> > > >

⚡Generated with XQuery