Discussion:
Sequences
(too old to reply)
Misztur, Chris
2014-01-31 23:55:21 UTC
Permalink
Is this a sequence of 7 or 9 items?

(
1,
2,
3,
(4,5,6),
7,
8,
9
)

________________________________

The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author.

Please consider the environment before printing this e-mail
David Lee
2014-02-01 00:04:38 UTC
Permalink
9

Now for the fun ... how big is this sequence
( (),((),()))


-----Original Message-----
From: talk-bounces-***@public.gmane.org [mailto:talk-bounces-***@public.gmane.org] On Behalf Of Misztur, Chris
Sent: Friday, January 31, 2014 6:55 PM
To: talk-***@public.gmane.org
Subject: [xquery-talk] Sequences

Is this a sequence of 7 or 9 items?

(
1,
2,
3,
(4,5,6),
7,
8,
9
)

________________________________

The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author.

Please consider the environment before printing this e-mail


_______________________________________________
talk-***@public.gmane.org
http://x-query.com/mailman/listinfo/talk
Misztur, Chris
2014-02-01 00:08:05 UTC
Permalink
3?

> On Jan 31, 2014, at 6:04 PM, "David Lee" <dlee-***@public.gmane.org> wrote:
>
> 9
>
> Now for the fun ... how big is this sequence
> ( (),((),()))
>
>
> -----Original Message-----
> From: talk-bounces-***@public.gmane.org [mailto:talk-bounces-***@public.gmane.org] On Behalf Of Misztur, Chris
> Sent: Friday, January 31, 2014 6:55 PM
> To: talk-***@public.gmane.org
> Subject: [xquery-talk] Sequences
>
> Is this a sequence of 7 or 9 items?
>
> (
> 1,
> 2,
> 3,
> (4,5,6),
> 7,
> 8,
> 9
> )
>
> ________________________________
>
> The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author.
>
> Please consider the environment before printing this e-mail
>
>
> _______________________________________________
> talk-***@public.gmane.org
> http://x-query.com/mailman/listinfo/talk

________________________________

The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author.

Please consider the environment before printing this e-mail
David Lee
2014-02-01 00:10:13 UTC
Permalink
0

-----Original Message-----
From: Misztur, Chris [mailto:CMisztur-I31r+Zvo+***@public.gmane.org]
Sent: Friday, January 31, 2014 7:08 PM
To: David Lee
Cc: talk-***@public.gmane.org
Subject: Re: Sequences

3?

> On Jan 31, 2014, at 6:04 PM, "David Lee" <dlee-***@public.gmane.org> wrote:
>
> 9
>
> Now for the fun ... how big is this sequence ( (),((),()))
>
>
> -----Original Message-----
> From: talk-bounces-***@public.gmane.org [mailto:talk-bounces-***@public.gmane.org] On Behalf Of Misztur, Chris
> Sent: Friday, January 31, 2014 6:55 PM
> To: talk-***@public.gmane.org
> Subject: [xquery-talk] Sequences
>
> Is this a sequence of 7 or 9 items?
>
> (
> 1,
> 2,
> 3,
> (4,5,6),
> 7,
> 8,
> 9
> )
>
> ________________________________
>
> The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author.
>
> Please consider the environment before printing this e-mail
>
>
> _______________________________________________
> talk-***@public.gmane.org
> http://x-query.com/mailman/listinfo/talk

________________________________

The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author.

Please consider the environment before printing this e-mail
Misztur, Chris
2014-02-01 00:28:17 UTC
Permalink
Interesting and this = 1

( (),((1),()))
________________________________________
From: David Lee [dlee-***@public.gmane.org]
Sent: Friday, January 31, 2014 6:10 PM
To: Misztur, Chris
Cc: talk-***@public.gmane.org
Subject: RE: Sequences

0

-----Original Message-----
From: Misztur, Chris [mailto:CMisztur-I31r+Zvo+***@public.gmane.org]
Sent: Friday, January 31, 2014 7:08 PM
To: David Lee
Cc: talk-***@public.gmane.org
Subject: Re: Sequences

3?

> On Jan 31, 2014, at 6:04 PM, "David Lee" <dlee-***@public.gmane.org> wrote:
>
> 9
>
> Now for the fun ... how big is this sequence ( (),((),()))
>
>
> -----Original Message-----
> From: talk-bounces-***@public.gmane.org [mailto:talk-bounces-***@public.gmane.org] On Behalf Of Misztur, Chris
> Sent: Friday, January 31, 2014 6:55 PM
> To: talk-***@public.gmane.org
> Subject: [xquery-talk] Sequences
>
> Is this a sequence of 7 or 9 items?
>
> (
> 1,
> 2,
> 3,
> (4,5,6),
> 7,
> 8,
> 9
> )
>
> ________________________________
>
> The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author.
>
> Please consider the environment before printing this e-mail
>
>
> _______________________________________________
> talk-***@public.gmane.org
> http://x-query.com/mailman/listinfo/talk

________________________________

The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author.

Please consider the environment before printing this e-mail


________________________________

The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author.

Please consider the environment before printing this e-mail
David Lee
2014-02-01 01:01:47 UTC
Permalink
Now your getting it!

Sent from my iPad (excuse the terseness)
David A Lee
dlee-***@public.gmane.org


> On Jan 31, 2014, at 7:28 PM, "Misztur, Chris" <CMisztur-I31r+Zvo+***@public.gmane.org> wrote:
>
> Interesting and this = 1
>
> ( (),((1),()))
> ________________________________________
> From: David Lee [dlee-***@public.gmane.org]
> Sent: Friday, January 31, 2014 6:10 PM
> To: Misztur, Chris
> Cc: talk-***@public.gmane.org
> Subject: RE: Sequences
>
> 0
>
> -----Original Message-----
> From: Misztur, Chris [mailto:CMisztur-I31r+Zvo+***@public.gmane.org]
> Sent: Friday, January 31, 2014 7:08 PM
> To: David Lee
> Cc: talk-***@public.gmane.org
> Subject: Re: Sequences
>
> 3?
>
>> On Jan 31, 2014, at 6:04 PM, "David Lee" <dlee-***@public.gmane.org> wrote:
>>
>> 9
>>
>> Now for the fun ... how big is this sequence ( (),((),()))
>>
>>
>> -----Original Message-----
>> From: talk-bounces-***@public.gmane.org [mailto:talk-bounces-***@public.gmane.org] On Behalf Of Misztur, Chris
>> Sent: Friday, January 31, 2014 6:55 PM
>> To: talk-***@public.gmane.org
>> Subject: [xquery-talk] Sequences
>>
>> Is this a sequence of 7 or 9 items?
>>
>> (
>> 1,
>> 2,
>> 3,
>> (4,5,6),
>> 7,
>> 8,
>> 9
>> )
>>
>> ________________________________
>>
>> The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author.
>>
>> Please consider the environment before printing this e-mail
>>
>>
>> _______________________________________________
>> talk-***@public.gmane.org
>> http://x-query.com/mailman/listinfo/talk
>
> ________________________________
>
> The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author.
>
> Please consider the environment before printing this e-mail
>
>
> ________________________________
>
> The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author.
>
> Please consider the environment before printing this e-mail
>
Misztur, Chris
2014-02-01 00:13:40 UTC
Permalink
So can I ever get at $seq[3][2]() ?

(1,2,(function(),function()),5,6)

> On Jan 31, 2014, at 6:04 PM, "David Lee" <dlee-***@public.gmane.org> wrote:
>
> 9
>
> Now for the fun ... how big is this sequence
> ( (),((),()))
>
>
> -----Original Message-----
> From: talk-bounces-***@public.gmane.org [mailto:talk-bounces-***@public.gmane.org] On Behalf Of Misztur, Chris
> Sent: Friday, January 31, 2014 6:55 PM
> To: talk-***@public.gmane.org
> Subject: [xquery-talk] Sequences
>
> Is this a sequence of 7 or 9 items?
>
> (
> 1,
> 2,
> 3,
> (4,5,6),
> 7,
> 8,
> 9
> )
>
> ________________________________
>
> The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author.
>
> Please consider the environment before printing this e-mail
>
>
> _______________________________________________
> talk-***@public.gmane.org
> http://x-query.com/mailman/listinfo/talk

________________________________

The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author.

Please consider the environment before printing this e-mail
David Lee
2014-02-01 00:16:52 UTC
Permalink
The piece if information you are missing is that sequences dont nest.
They flatten.
(1,2,3) == (1,(2,3)) == (1,((2),(3)) ...
No such thing as sequences inside a sequence (unlike what you might expect if you thought of them as arrays.

So
let $a := (1,2,(function(),function()),5,6) ==

(1,2,function(),function(),5,6)

{( assuming you mean a full function declaration )}

$a[3] == function() ...
$a[3][2] == ()



-----Original Message-----
From: Misztur, Chris [mailto:CMisztur-I31r+Zvo+***@public.gmane.org]
Sent: Friday, January 31, 2014 7:14 PM
To: David Lee
Cc: talk-***@public.gmane.org
Subject: Re: Sequences

So can I ever get at $seq[3][2]() ?

(1,2,(function(),function()),5,6)

> On Jan 31, 2014, at 6:04 PM, "David Lee" <dlee-***@public.gmane.org> wrote:
>
> 9
>
> Now for the fun ... how big is this sequence ( (),((),()))
>
>
> -----Original Message-----
> From: talk-bounces-***@public.gmane.org [mailto:talk-bounces-***@public.gmane.org] On Behalf Of Misztur, Chris
> Sent: Friday, January 31, 2014 6:55 PM
> To: talk-***@public.gmane.org
> Subject: [xquery-talk] Sequences
>
> Is this a sequence of 7 or 9 items?
>
> (
> 1,
> 2,
> 3,
> (4,5,6),
> 7,
> 8,
> 9
> )
>
> ________________________________
>
> The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author.
>
> Please consider the environment before printing this e-mail
>
>
> _______________________________________________
> talk-***@public.gmane.org
> http://x-query.com/mailman/listinfo/talk

________________________________

The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author.

Please consider the environment before printing this e-mail
Adam Retter
2014-02-01 14:48:26 UTC
Permalink
On 1 February 2014 00:13, Misztur, Chris <CMisztur-I31r+Zvo+***@public.gmane.org> wrote:
> So can I ever get at $seq[3][2]() ?
>
> (1,2,(function(),function()),5,6)
>

For something like that, your best bet would be Arrays which are
coming in XQuery 3.1 (most likely).

For the time being you could use maps of sequences, or there are
tricks you can do with sequences of functions and even maps of
functions, or if you really want fun, then just functions of functions
of functions of...

However if you don't want to loose your mind and you can get away with
it, then I would just create an XML representation of an array, and a
module of functions to manage update, insert, delete etc.

--
Adam Retter

skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk
jean-marc Mercier
2014-02-01 16:14:26 UTC
Permalink
Chris,

If really needed, some of us already coded containers mimicking arrays with
XQUERY3.0 (i.e. they would answer 7 to your question).
The bad point is that, would you need them for intensive computing, then I
would advise to wait XQUERY 3.1, because these containers suffers from
performance issues for algebraic operations, an inherent problem to XQUERY
3.0.

Hope this helps






2014-02-01 Adam Retter <adam.retter-gM/Ye1E23mwN+***@public.gmane.org>:

> On 1 February 2014 00:13, Misztur, Chris <CMisztur-I31r+Zvo+***@public.gmane.org> wrote:
> > So can I ever get at $seq[3][2]() ?
> >
> > (1,2,(function(),function()),5,6)
> >
>
> For something like that, your best bet would be Arrays which are
> coming in XQuery 3.1 (most likely).
>
> For the time being you could use maps of sequences, or there are
> tricks you can do with sequences of functions and even maps of
> functions, or if you really want fun, then just functions of functions
> of functions of...
>
> However if you don't want to loose your mind and you can get away with
> it, then I would just create an XML representation of an array, and a
> module of functions to manage update, insert, delete etc.
>
> --
> Adam Retter
>
> skype: adam.retter
> tweet: adamretter
> http://www.adamretter.org.uk
> _______________________________________________
> talk-***@public.gmane.org
> http://x-query.com/mailman/listinfo/talk
>
Eric Bloch
2014-02-01 00:07:02 UTC
Permalink
9


On Jan 31, 2014, at 3:55 PM, "Misztur, Chris" <CMisztur-I31r+Zvo+***@public.gmane.org<mailto:CMisztur-I31r+Zvo+***@public.gmane.org>>
wrote:

(
1,
2,
3,
(4,5,6),
7,
8,
9
)
Mukul Gandhi
2014-02-01 07:39:49 UTC
Permalink
I think, this is sequence of 7 items. As far as I can recall, the internal
sequence (4,5,6) won't be expanded to get the size of outer sequence and
would contribute one item to this result.

On Sat, Feb 1, 2014 at 5:25 AM, Misztur, Chris <CMisztur-I31r+Zvo+***@public.gmane.org>wrote:

> Is this a sequence of 7 or 9 items?
>
> (
> 1,
> 2,
> 3,
> (4,5,6),
> 7,
> 8,
> 9
> )
>
> ________________________________
>
> The contents of this message may be privileged and confidential.
> Therefore, if this message has been received in error, please delete it
> without reading it. Your receipt of this message is not intended to waive
> any applicable privilege. Please do not disseminate this message without
> the permission of the author.
>
> Please consider the environment before printing this e-mail
>
>
> _______________________________________________
> talk-***@public.gmane.org
> http://x-query.com/mailman/listinfo/talk
>



--
Regards,
Mukul Gandhi
David Lee
2014-02-01 11:28:37 UTC
Permalink
You would be mistaken
Try it


Sent from my iPhone

On Feb 1, 2014, at 1:41 AM, "Mukul Gandhi" <gandhi.mukul-***@public.gmane.org<mailto:gandhi.mukul-***@public.gmane.org>> wrote:

I think, this is sequence of 7 items. As far as I can recall, the internal sequence (4,5,6) won't be expanded to get the size of outer sequence and would contribute one item to this result.

On Sat, Feb 1, 2014 at 5:25 AM, Misztur, Chris <CMisztur-I31r+Zvo+***@public.gmane.org<mailto:CMisztur-I31r+Zvo+***@public.gmane.org>> wrote:
Is this a sequence of 7 or 9 items?

(
1,
2,
3,
(4,5,6),
7,
8,
9
)

________________________________

The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author.

Please consider the environment before printing this e-mail


_______________________________________________
talk-***@public.gmane.org<mailto:talk-***@public.gmane.org>
http://x-query.com/mailman/listinfo/talk



--
Regards,
Mukul Gandhi
_______________________________________________
talk-***@public.gmane.org<mailto:talk-***@public.gmane.org>
http://x-query.com/mailman/listinfo/talk
Mukul Gandhi
2014-02-01 20:37:12 UTC
Permalink
you're right. The answer to this question is 9.

I've checked with two XPath 2.0 (i'm assuming XQuery 1.0) processors, and
this answer is correct.

On Sat, Feb 1, 2014 at 4:58 PM, David Lee <dlee-***@public.gmane.org> wrote:

> You would be mistaken
> Try it
>
>
> Sent from my iPhone
>
> On Feb 1, 2014, at 1:41 AM, "Mukul Gandhi" <gandhi.mukul-***@public.gmane.org> wrote:
>
> I think, this is sequence of 7 items. As far as I can recall, the
> internal sequence (4,5,6) won't be expanded to get the size of outer
> sequence and would contribute one item to this result.
>
> On Sat, Feb 1, 2014 at 5:25 AM, Misztur, Chris <CMisztur-I31r+Zvo+***@public.gmane.org>wrote:
>
>> Is this a sequence of 7 or 9 items?
>>
>> (
>> 1,
>> 2,
>> 3,
>> (4,5,6),
>> 7,
>> 8,
>> 9
>> )
>>
>> ________________________________
>>
>> The contents of this message may be privileged and confidential.
>> Therefore, if this message has been received in error, please delete it
>> without reading it. Your receipt of this message is not intended to waive
>> any applicable privilege. Please do not disseminate this message without
>> the permission of the author.
>>
>> Please consider the environment before printing this e-mail
>>
>


--
Regards,
Mukul Gandhi
Continue reading on narkive:
Loading...