From: Thomas W. <tho...@gm...> - 2010-07-21 11:05:26
|
James, On the top of the configuration setting it will be a good idea to have an option set the value on fly for the current running XQuery. We may have cases where on the same machine we have old and new code and we need to make sure changing the setting in the config to the current behavior will still allow the new code to run properly switching on fly to the new mode. I hope this will help. Thomas ------ Thomas White Mobile:+44 7711 922 966 Skype: thomaswhite gTalk: thomas.0007 Linked-In:http://www.linkedin.com/in/thomaswhite0007 facebook: http://www.facebook.com/thomas.0007 On 21 July 2010 11:30, James Fuller <jam...@ex...> wrote: > sure, > > but I think this maybe a far ranging issue, e.g. > > declare function local:test(){ > //* > }; > > local:test() > > demonstrates that irregardless of arity, functions called do not > restriction any xquery context ... this would have some pretty big > ramifications for people's existing xquery code/apps that expect the > behavior; perhaps we need to introduce an exist option to be able to > switch/configure. > > It also means that its not just a simple check on xquery context, say > in the abstract class org.exist.xquery.Function but we have to do some > changes to ensure that no xquery context at all is provided. > > unsure about doing this, any more thoughts ? > > thx, J > > > On 21 July 2010 12:16, Adam Retter <ad...@ex...> wrote: > > Yes I agree we should fix this, are you volunteering ;-) > > > > On 18 July 2010 10:35, James Fuller <jam...@ex...> wrote: > >> courtesy Norm Walsh via twitter > >> > >> paraphrasing: 'During eval of a fn, the context item, pos, size is > >> undefined, except where it is def by some expr inside the fn' > >> > >> section 3.1.5 Function Calls in XQuery spec defines the correct > >> behavior for this. > >> > >> so looks like we need to sort this out, we should probably also create > >> an xquery level unit test for this as well ... something I think we > >> should do whenever we apply a patch/bug/tweak that can be > >> characterized easily as expected result from xquery unit test. > >> > >> J > >> > >> > >> > >> > >> On 17 July 2010 14:21, Dmitriy Shabanov <sha...@gm...> wrote: > >>> On Sat, 2010-07-17 at 13:31 +0200, James Fuller wrote: > >>>> I can appreciate that both functions ( e.g. local:test() and name() ) > >>>> when given no argument use default context but can't find in xquery > >>>> related specs what the rules are for default context for a function > >>>> with no arguments. > >>> > >>> The function don't have context. You right, it should throw error. > (BTW, > >>> I like the way it work now) > >>> > >>>> should this throw an [XPDY0002] evaluation of an expression relies on > >>>> some part of the dynamic context that has not been assigned a value: > >>>> {context item}. > >>> > >>> -- > >>> Cheers, > >>> > >>> Dmitriy Shabanov > >>> > >>> > >> > >> > ------------------------------------------------------------------------------ > >> This SF.net email is sponsored by Sprint > >> What will you do first with EVO, the first 4G phone? > >> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > >> _______________________________________________ > >> Exist-development mailing list > >> Exi...@li... > >> https://lists.sourceforge.net/lists/listinfo/exist-development > >> > > > > > > > > -- > > Adam Retter > > > > eXist Developer > > { United Kingdom } > > ad...@ex... > > irc://irc.freenode.net/existdb > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Exist-development mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-development > |