Re: [basex-talk] xquery:eval bug?

2016-01-19 Thread Marc van Grootel
And I can confirm that my code now also runs when MIXUPDATES=true

Although the code isn't meant to be shared yet as it's very much WIP
here's the example I"m running:
https://github.com/xokomola/origami-examples/blob/master/check/check-demo.xq

It's running all the Origami test cases via a custom built test
harness (tests are evaluated via xquery:eval).

--Marc

On Mon, Jan 18, 2016 at 1:51 PM, Christian Grün
<christian.gr...@gmail.com> wrote:
> Hi Marc, hi Andy,
>
> Confirmed, it seems to be the MIXUPDATES option. Once again, I noticed
> it’s tricky to statically detect which dynamic function calls will
> perform updates. Obviously, in the given case, there was no updating
> code at all, so the error message was a bit misleading.
>
> Feedback on the MIXUPDATES option is always welcome. I have just
> uploaded a new snapshot [1].
>
> Christian
>
> [1] http://files.basex.org/releases/latest/
>
>
>
> On Mon, Jan 18, 2016 at 12:58 PM, Marc van Grootel
> <marc.vangroo...@theapsgroup.com> wrote:
>> Hi Christian,
>>
>> Yes, I think so. I think MIXUPDATES=true could be the difference. I almost 
>> forgot about these as I always run basex from a Gradle script which sets 
>> these [1]
>>
>> [1] 
>> https://github.com/theapsgroup/basex-gradle-starter/blob/master/gradle.properties
>>
>> -Original Message-
>> From: basex-talk-boun...@mailman.uni-konstanz.de 
>> [mailto:basex-talk-boun...@mailman.uni-konstanz.de] On Behalf Of Christian 
>> Grün
>> Sent: Monday, January 18, 2016 11:32 AM
>> To: Marc van Grootel <marc.van.groo...@gmail.com>
>> Cc: BaseX <basex-talk@mailman.uni-konstanz.de>
>> Subject: Re: [basex-talk] xquery:eval bug?
>>
>> Hi Marc,
>>
>> It runs fine on my environment. Could you give me some more information on 
>> your set up (have you assigned any non-default options)?
>>
>> Christian
>>
>>
>> On Mon, Jan 18, 2016 at 10:07 AM, Marc van Grootel 
>> <marc.van.groo...@gmail.com> wrote:
>>> Hi Christian,
>>>
>>> Seems to work fine with latest snapshot with some straightforward
>>> cases but I do get an error in some cases which I cannot understand.
>>> Though I appreciate that it may be difficult to support all types of
>>> dynamic calls.
>>>
>>> The error is: [bxerr:BXXQ0001] No updating expression allowed.
>>>
>>> I am not using updating expressions. I also tried this in my little
>>> test project and it runs against the same error. I haven't been able
>>> to pinpoint it yet as it happens deep in the bowels of the code. When
>>> I'm able to I will let you know.
>>>
>>> You can use a simple/small set of unit tests to verify [1]. I've
>>> %unit:ignored the last test that causes the error above.
>>>
>>> Cheers,
>>> --Marc
>>>
>>> [1]
>>> https://github.com/xokomola/origami-examples/blob/master/check/test-ev
>>> al.xqm
>>>
>>> On Fri, Jan 15, 2016 at 6:57 PM, Christian Grün
>>> <christian.gr...@gmail.com> wrote:
>>>> Hi Marc,
>>>>
>>>> This was a deliberate restriction: As maps and arrays are function
>>>> items, and as they can contain references to other functions that
>>>> have been declared in the evaluated query, it is generally tricky to
>>>> evaluate and return them dynamically.
>>>>
>>>> However, I spent some more thoughts on the underlying semantics, and
>>>> I may have found a solution that overcomes some of the earlier
>>>> limitations.
>>>>
>>>> A new snapshot is available [1], which now allows you to return
>>>> function items (incl. maps and arrays) as result of xquery:eval. Your
>>>> testing feedback will be welcome.
>>>>
>>>> Christian
>>>>
>>>> [1] http://files.basex.org/releases/latest/
>>>>
>>>>
>>>>
>>>> On Thu, Jan 14, 2016 at 11:17 PM, Marc van Grootel
>>>> <marc.van.groo...@gmail.com> wrote:
>>>>> Hi,
>>>>>
>>>>> I'm trying to return a map or an array from xquery:eval. Seems this
>>>>> is not possible, yet the signature says it returns item()*
>>>>>
>>>>> xquery:eval('1 + 1') => 2
>>>>> xquery:eval('[1,2]') => ERROR: [FOTY0014] Items of type array(*)
>>>>> have no string representation.
>>>>> xquery:eval('map { "x": 10 }') => ERROR: [FOTY0014] 

Re: [basex-talk] xquery:eval bug?

2016-01-18 Thread Marc van Grootel
Hi Christian,

Seems to work fine with latest snapshot with some straightforward
cases but I do get an error in some cases which I cannot understand.
Though I appreciate that it may be difficult to support all types of
dynamic calls.

The error is: [bxerr:BXXQ0001] No updating expression allowed.

I am not using updating expressions. I also tried this in my little
test project and it runs against the same error. I haven't been able
to pinpoint it yet as it happens deep in the bowels of the code. When
I'm able to I will let you know.

You can use a simple/small set of unit tests to verify [1]. I've
%unit:ignored the last test that causes the error above.

Cheers,
--Marc

[1] https://github.com/xokomola/origami-examples/blob/master/check/test-eval.xqm

On Fri, Jan 15, 2016 at 6:57 PM, Christian Grün
 wrote:
> Hi Marc,
>
> This was a deliberate restriction: As maps and arrays are function
> items, and as they can contain references to other functions that have
> been declared in the evaluated query, it is generally tricky to
> evaluate and return them dynamically.
>
> However, I spent some more thoughts on the underlying semantics, and I
> may have found a solution that overcomes some of the earlier
> limitations.
>
> A new snapshot is available [1], which now allows you to return
> function items (incl. maps and arrays) as result of xquery:eval. Your
> testing feedback will be welcome.
>
> Christian
>
> [1] http://files.basex.org/releases/latest/
>
>
>
> On Thu, Jan 14, 2016 at 11:17 PM, Marc van Grootel
>  wrote:
>> Hi,
>>
>> I'm trying to return a map or an array from xquery:eval. Seems this is
>> not possible, yet the signature says it returns item()*
>>
>> xquery:eval('1 + 1') => 2
>> xquery:eval('[1,2]') => ERROR: [FOTY0014] Items of type array(*)
>> have no string representation.
>> xquery:eval('map { "x": 10 }') => ERROR: [FOTY0014] Items of type
>> map(*) have no string representation.
>>
>> BTW: I saw that xquery:eval#3 is documented as returning item() while
>> the other arities return item()*
>>
>> Tested on 8.3, haven't tested yet on 8.4beta but it's trivial to repro I 
>> figure.
>>
>> --
>> --Marc



-- 
--Marc


Re: [basex-talk] xquery:eval bug?

2016-01-18 Thread Christian Grün
Hi Marc,

It runs fine on my environment. Could you give me some more
information on your set up (have you assigned any non-default
options)?

Christian


On Mon, Jan 18, 2016 at 10:07 AM, Marc van Grootel
 wrote:
> Hi Christian,
>
> Seems to work fine with latest snapshot with some straightforward
> cases but I do get an error in some cases which I cannot understand.
> Though I appreciate that it may be difficult to support all types of
> dynamic calls.
>
> The error is: [bxerr:BXXQ0001] No updating expression allowed.
>
> I am not using updating expressions. I also tried this in my little
> test project and it runs against the same error. I haven't been able
> to pinpoint it yet as it happens deep in the bowels of the code. When
> I'm able to I will let you know.
>
> You can use a simple/small set of unit tests to verify [1]. I've
> %unit:ignored the last test that causes the error above.
>
> Cheers,
> --Marc
>
> [1] 
> https://github.com/xokomola/origami-examples/blob/master/check/test-eval.xqm
>
> On Fri, Jan 15, 2016 at 6:57 PM, Christian Grün
>  wrote:
>> Hi Marc,
>>
>> This was a deliberate restriction: As maps and arrays are function
>> items, and as they can contain references to other functions that have
>> been declared in the evaluated query, it is generally tricky to
>> evaluate and return them dynamically.
>>
>> However, I spent some more thoughts on the underlying semantics, and I
>> may have found a solution that overcomes some of the earlier
>> limitations.
>>
>> A new snapshot is available [1], which now allows you to return
>> function items (incl. maps and arrays) as result of xquery:eval. Your
>> testing feedback will be welcome.
>>
>> Christian
>>
>> [1] http://files.basex.org/releases/latest/
>>
>>
>>
>> On Thu, Jan 14, 2016 at 11:17 PM, Marc van Grootel
>>  wrote:
>>> Hi,
>>>
>>> I'm trying to return a map or an array from xquery:eval. Seems this is
>>> not possible, yet the signature says it returns item()*
>>>
>>> xquery:eval('1 + 1') => 2
>>> xquery:eval('[1,2]') => ERROR: [FOTY0014] Items of type array(*)
>>> have no string representation.
>>> xquery:eval('map { "x": 10 }') => ERROR: [FOTY0014] Items of type
>>> map(*) have no string representation.
>>>
>>> BTW: I saw that xquery:eval#3 is documented as returning item() while
>>> the other arities return item()*
>>>
>>> Tested on 8.3, haven't tested yet on 8.4beta but it's trivial to repro I 
>>> figure.
>>>
>>> --
>>> --Marc
>
>
>
> --
> --Marc


Re: [basex-talk] xquery:eval bug?

2016-01-18 Thread Marc van Grootel
Hi Christian,

Yes, I think so. I think MIXUPDATES=true could be the difference. I almost 
forgot about these as I always run basex from a Gradle script which sets these 
[1]

[1] 
https://github.com/theapsgroup/basex-gradle-starter/blob/master/gradle.properties

-Original Message-
From: basex-talk-boun...@mailman.uni-konstanz.de 
[mailto:basex-talk-boun...@mailman.uni-konstanz.de] On Behalf Of Christian Grün
Sent: Monday, January 18, 2016 11:32 AM
To: Marc van Grootel <marc.van.groo...@gmail.com>
Cc: BaseX <basex-talk@mailman.uni-konstanz.de>
Subject: Re: [basex-talk] xquery:eval bug?

Hi Marc,

It runs fine on my environment. Could you give me some more information on your 
set up (have you assigned any non-default options)?

Christian


On Mon, Jan 18, 2016 at 10:07 AM, Marc van Grootel <marc.van.groo...@gmail.com> 
wrote:
> Hi Christian,
>
> Seems to work fine with latest snapshot with some straightforward
> cases but I do get an error in some cases which I cannot understand.
> Though I appreciate that it may be difficult to support all types of
> dynamic calls.
>
> The error is: [bxerr:BXXQ0001] No updating expression allowed.
>
> I am not using updating expressions. I also tried this in my little
> test project and it runs against the same error. I haven't been able
> to pinpoint it yet as it happens deep in the bowels of the code. When
> I'm able to I will let you know.
>
> You can use a simple/small set of unit tests to verify [1]. I've
> %unit:ignored the last test that causes the error above.
>
> Cheers,
> --Marc
>
> [1]
> https://github.com/xokomola/origami-examples/blob/master/check/test-ev
> al.xqm
>
> On Fri, Jan 15, 2016 at 6:57 PM, Christian Grün
> <christian.gr...@gmail.com> wrote:
>> Hi Marc,
>>
>> This was a deliberate restriction: As maps and arrays are function
>> items, and as they can contain references to other functions that
>> have been declared in the evaluated query, it is generally tricky to
>> evaluate and return them dynamically.
>>
>> However, I spent some more thoughts on the underlying semantics, and
>> I may have found a solution that overcomes some of the earlier
>> limitations.
>>
>> A new snapshot is available [1], which now allows you to return
>> function items (incl. maps and arrays) as result of xquery:eval. Your
>> testing feedback will be welcome.
>>
>> Christian
>>
>> [1] http://files.basex.org/releases/latest/
>>
>>
>>
>> On Thu, Jan 14, 2016 at 11:17 PM, Marc van Grootel
>> <marc.van.groo...@gmail.com> wrote:
>>> Hi,
>>>
>>> I'm trying to return a map or an array from xquery:eval. Seems this
>>> is not possible, yet the signature says it returns item()*
>>>
>>> xquery:eval('1 + 1') => 2
>>> xquery:eval('[1,2]') => ERROR: [FOTY0014] Items of type array(*)
>>> have no string representation.
>>> xquery:eval('map { "x": 10 }') => ERROR: [FOTY0014] Items of
>>> type
>>> map(*) have no string representation.
>>>
>>> BTW: I saw that xquery:eval#3 is documented as returning item()
>>> while the other arities return item()*
>>>
>>> Tested on 8.3, haven't tested yet on 8.4beta but it's trivial to repro I 
>>> figure.
>>>
>>> --
>>> --Marc
>
>
>
> --
> --Marc

__
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com 
__
'**
This E-mail and any files transmitted with it are private and confidential and 
are solely for the use of the addressee.  It may contain material which is 
legally privileged.  If you are not the addressee, be advised that you have 
received this E-mail in error and that any use of it is strictly prohibited.

If you have received this E-mail in error, please notify APS on +44 (0)161 495 
4500, or E-mail administra...@theapsgroup.com.
Any opinions expressed in the E-mail are those of the individual writer of it 
and not necessarily the Company unless specifically stated otherwise.  There is 
no intention to create any legally binding contract or other commitment through 
use of this E-mail

We cannot accept any liability for any loss or damage sustained as a result of 
software viruses.  It is your responsibility to carry out such virus checking 
as is necessary before downloading this E-mail and any attachments onto your 
computer system.

Allied Publicity Services (Man

Re: [basex-talk] xquery:eval bug?

2016-01-18 Thread Christian Grün
Hi Marc, hi Andy,

Confirmed, it seems to be the MIXUPDATES option. Once again, I noticed
it’s tricky to statically detect which dynamic function calls will
perform updates. Obviously, in the given case, there was no updating
code at all, so the error message was a bit misleading.

Feedback on the MIXUPDATES option is always welcome. I have just
uploaded a new snapshot [1].

Christian

[1] http://files.basex.org/releases/latest/



On Mon, Jan 18, 2016 at 12:58 PM, Marc van Grootel
<marc.vangroo...@theapsgroup.com> wrote:
> Hi Christian,
>
> Yes, I think so. I think MIXUPDATES=true could be the difference. I almost 
> forgot about these as I always run basex from a Gradle script which sets 
> these [1]
>
> [1] 
> https://github.com/theapsgroup/basex-gradle-starter/blob/master/gradle.properties
>
> -Original Message-
> From: basex-talk-boun...@mailman.uni-konstanz.de 
> [mailto:basex-talk-boun...@mailman.uni-konstanz.de] On Behalf Of Christian 
> Grün
> Sent: Monday, January 18, 2016 11:32 AM
> To: Marc van Grootel <marc.van.groo...@gmail.com>
> Cc: BaseX <basex-talk@mailman.uni-konstanz.de>
> Subject: Re: [basex-talk] xquery:eval bug?
>
> Hi Marc,
>
> It runs fine on my environment. Could you give me some more information on 
> your set up (have you assigned any non-default options)?
>
> Christian
>
>
> On Mon, Jan 18, 2016 at 10:07 AM, Marc van Grootel 
> <marc.van.groo...@gmail.com> wrote:
>> Hi Christian,
>>
>> Seems to work fine with latest snapshot with some straightforward
>> cases but I do get an error in some cases which I cannot understand.
>> Though I appreciate that it may be difficult to support all types of
>> dynamic calls.
>>
>> The error is: [bxerr:BXXQ0001] No updating expression allowed.
>>
>> I am not using updating expressions. I also tried this in my little
>> test project and it runs against the same error. I haven't been able
>> to pinpoint it yet as it happens deep in the bowels of the code. When
>> I'm able to I will let you know.
>>
>> You can use a simple/small set of unit tests to verify [1]. I've
>> %unit:ignored the last test that causes the error above.
>>
>> Cheers,
>> --Marc
>>
>> [1]
>> https://github.com/xokomola/origami-examples/blob/master/check/test-ev
>> al.xqm
>>
>> On Fri, Jan 15, 2016 at 6:57 PM, Christian Grün
>> <christian.gr...@gmail.com> wrote:
>>> Hi Marc,
>>>
>>> This was a deliberate restriction: As maps and arrays are function
>>> items, and as they can contain references to other functions that
>>> have been declared in the evaluated query, it is generally tricky to
>>> evaluate and return them dynamically.
>>>
>>> However, I spent some more thoughts on the underlying semantics, and
>>> I may have found a solution that overcomes some of the earlier
>>> limitations.
>>>
>>> A new snapshot is available [1], which now allows you to return
>>> function items (incl. maps and arrays) as result of xquery:eval. Your
>>> testing feedback will be welcome.
>>>
>>> Christian
>>>
>>> [1] http://files.basex.org/releases/latest/
>>>
>>>
>>>
>>> On Thu, Jan 14, 2016 at 11:17 PM, Marc van Grootel
>>> <marc.van.groo...@gmail.com> wrote:
>>>> Hi,
>>>>
>>>> I'm trying to return a map or an array from xquery:eval. Seems this
>>>> is not possible, yet the signature says it returns item()*
>>>>
>>>> xquery:eval('1 + 1') => 2
>>>> xquery:eval('[1,2]') => ERROR: [FOTY0014] Items of type array(*)
>>>> have no string representation.
>>>> xquery:eval('map { "x": 10 }') => ERROR: [FOTY0014] Items of
>>>> type
>>>> map(*) have no string representation.
>>>>
>>>> BTW: I saw that xquery:eval#3 is documented as returning item()
>>>> while the other arities return item()*
>>>>
>>>> Tested on 8.3, haven't tested yet on 8.4beta but it's trivial to repro I 
>>>> figure.
>>>>
>>>> --
>>>> --Marc
>>
>>
>>
>> --
>> --Marc
>
> __
> This email has been scanned by the Symantec Email Security.cloud service.
> For more information please visit http://www.symanteccloud.com 
> __
> '

Re: [basex-talk] xquery:eval bug?

2016-01-18 Thread Andy Bunce
Works for me if MIXUPDATES is not true.
I have found previously that MIXUPDATES has a lot consequences that are not
always desirable or predictable - at least for me.
/Andy

On 18 January 2016 at 10:31, Christian Grün 
wrote:

> Hi Marc,
>
> It runs fine on my environment. Could you give me some more
> information on your set up (have you assigned any non-default
> options)?
>
> Christian
>
>
> On Mon, Jan 18, 2016 at 10:07 AM, Marc van Grootel
>  wrote:
> > Hi Christian,
> >
> > Seems to work fine with latest snapshot with some straightforward
> > cases but I do get an error in some cases which I cannot understand.
> > Though I appreciate that it may be difficult to support all types of
> > dynamic calls.
> >
> > The error is: [bxerr:BXXQ0001] No updating expression allowed.
> >
> > I am not using updating expressions. I also tried this in my little
> > test project and it runs against the same error. I haven't been able
> > to pinpoint it yet as it happens deep in the bowels of the code. When
> > I'm able to I will let you know.
> >
> > You can use a simple/small set of unit tests to verify [1]. I've
> > %unit:ignored the last test that causes the error above.
> >
> > Cheers,
> > --Marc
> >
> > [1]
> https://github.com/xokomola/origami-examples/blob/master/check/test-eval.xqm
> >
> > On Fri, Jan 15, 2016 at 6:57 PM, Christian Grün
> >  wrote:
> >> Hi Marc,
> >>
> >> This was a deliberate restriction: As maps and arrays are function
> >> items, and as they can contain references to other functions that have
> >> been declared in the evaluated query, it is generally tricky to
> >> evaluate and return them dynamically.
> >>
> >> However, I spent some more thoughts on the underlying semantics, and I
> >> may have found a solution that overcomes some of the earlier
> >> limitations.
> >>
> >> A new snapshot is available [1], which now allows you to return
> >> function items (incl. maps and arrays) as result of xquery:eval. Your
> >> testing feedback will be welcome.
> >>
> >> Christian
> >>
> >> [1] http://files.basex.org/releases/latest/
> >>
> >>
> >>
> >> On Thu, Jan 14, 2016 at 11:17 PM, Marc van Grootel
> >>  wrote:
> >>> Hi,
> >>>
> >>> I'm trying to return a map or an array from xquery:eval. Seems this is
> >>> not possible, yet the signature says it returns item()*
> >>>
> >>> xquery:eval('1 + 1') => 2
> >>> xquery:eval('[1,2]') => ERROR: [FOTY0014] Items of type array(*)
> >>> have no string representation.
> >>> xquery:eval('map { "x": 10 }') => ERROR: [FOTY0014] Items of type
> >>> map(*) have no string representation.
> >>>
> >>> BTW: I saw that xquery:eval#3 is documented as returning item() while
> >>> the other arities return item()*
> >>>
> >>> Tested on 8.3, haven't tested yet on 8.4beta but it's trivial to repro
> I figure.
> >>>
> >>> --
> >>> --Marc
> >
> >
> >
> > --
> > --Marc
>


Re: [basex-talk] xquery:eval bug?

2016-01-15 Thread Christian Grün
Hi Marc,

This was a deliberate restriction: As maps and arrays are function
items, and as they can contain references to other functions that have
been declared in the evaluated query, it is generally tricky to
evaluate and return them dynamically.

However, I spent some more thoughts on the underlying semantics, and I
may have found a solution that overcomes some of the earlier
limitations.

A new snapshot is available [1], which now allows you to return
function items (incl. maps and arrays) as result of xquery:eval. Your
testing feedback will be welcome.

Christian

[1] http://files.basex.org/releases/latest/



On Thu, Jan 14, 2016 at 11:17 PM, Marc van Grootel
 wrote:
> Hi,
>
> I'm trying to return a map or an array from xquery:eval. Seems this is
> not possible, yet the signature says it returns item()*
>
> xquery:eval('1 + 1') => 2
> xquery:eval('[1,2]') => ERROR: [FOTY0014] Items of type array(*)
> have no string representation.
> xquery:eval('map { "x": 10 }') => ERROR: [FOTY0014] Items of type
> map(*) have no string representation.
>
> BTW: I saw that xquery:eval#3 is documented as returning item() while
> the other arities return item()*
>
> Tested on 8.3, haven't tested yet on 8.4beta but it's trivial to repro I 
> figure.
>
> --
> --Marc


[basex-talk] xquery:eval bug?

2016-01-14 Thread Marc van Grootel
Hi,

I'm trying to return a map or an array from xquery:eval. Seems this is
not possible, yet the signature says it returns item()*

xquery:eval('1 + 1') => 2
xquery:eval('[1,2]') => ERROR: [FOTY0014] Items of type array(*)
have no string representation.
xquery:eval('map { "x": 10 }') => ERROR: [FOTY0014] Items of type
map(*) have no string representation.

BTW: I saw that xquery:eval#3 is documented as returning item() while
the other arities return item()*

Tested on 8.3, haven't tested yet on 8.4beta but it's trivial to repro I figure.

-- 
--Marc