Hi France,

I'm wondering what you mean with tracking. Is it to gather diagnostics during development? Is it for adding logging or is it part of running production code? Do you want to add this to every function or only a few specific ones?

Maybe some kind tracing/profiling mechanism could provide this without altering your running code. But I'm not sure if that's what you are after.

If this tracking is a real feature of your code then it's different. I hope your request is not because your functions have a lot of arguments. That would be an indication that your code needs some refactoring :)

Could you tell us what you mean with tracking capabilities?

--Marc

On 18 aug. 2014, at 21:39, Andy Bunce <bunce.andy@gmail.com> wrote:

Hi France,

I think this is not possible, but I think it would be a good thing!
I think it is related to Marc's query about
call an anonymous function with a variable argument list [1]

XQuery provides no access to the stack.
But..I can see that one could implement a new function maybe in the BaseX profiling module [2] that returns a map.
The keys would be the argument names of the function being executed and the values those of the current arguments.

All that is required is to implement it :-)

/Andy

[1] http://www.mail-archive.com/basex-talk%40mailman.uni-konstanz.de/msg04539.html
[2] http://docs.basex.org/wiki/Profiling_Module



On 18 August 2014 18:14, France Baril <france.baril@architextus.com> wrote:
Hi, 

I'm working on improving our tracking capabilities. I was hoping to find a function that would do the equivalent of what the code bellow does, but for internal functions that are not called through the rest interface.

string-join(for $name in request:parameter-names()
                 return $name || ':&#32;'
                              || string-join(request:parameter($name), ';&#32;'),

                 '&#10;') 

In short, I was wondering if there is way I can read the function's parameters and their values without listing each one explicitly.

I searched the documentation without success. 

--
France Baril
Architecte documentaire / Documentation architect
france.baril@architextus.com