Boost logo

Boost :

Subject: [boost] [fusion] adding infinite sequences to fusion
From: Stjepan Rajko (stjepan.rajko_at_[hidden])
Date: 2009-04-18 19:53:06


Hi all,

There's been some off-list discussion between Dan Marsden, Joel de
Guzman and myself on how to address infinite sequences in fusion.
Joel suggested to bring the discussion back to the list for more
feedback:

On Wed, Apr 15, 2009 at 6:21 PM, Joel de Guzman <djowel_at_[hidden]> wrote:
> Stjepan Rajko wrote:
>>
>> Here is a list and description of all of the concepts that might be
>> relevant:
>>
>>
>> Forward Sequence
>> begin(s) - returns a Forward Iterator
>> empty(s) - returns a bool
>> front(s) - any type
>>
>> Finite Forward Sequence
>> refines Forward Sequence
>> end(s) - returns a Forward Iterator
>> size(s) - MPL integral constant
>>
>> Infinite Forward Sequence
>> refines Forward Sequence
>> empty(s) - returns false
>> size(s) - infinity
>>
>> Bidirectional Sequence
>> refines Forward Sequence
>> begin(s) - returns a Bidirectional Iterator
>>
>> Finite Bidirectional Sequence
>> refines Bidirectional Sequence, Finite Forward Sequence
>> end(s) - returns a Bidirectional Iterator
>> back(s) - any type
>>
>> Infinite Bidirectional Sequence
>> refines Bidirectional Sequence, Infinite Forward Sequence
>>
>> Random Access Sequence
>> refines Bidirectional Sequence
>> begin(s) - returns a Random Access Iterator
>>
>> Finite Random Access Sequence
>> refines Random Access Sequence, Finite Bidirectional Sequence
>> end(s) - returns a Random Access Iterator
>>
>> Infinite Random Access Sequence
>> refines Random Access Sequence, Infinite Bidirectional Sequence
>>
>>
>> How does that look?
>
> I'd suggest posting that to the Boost list to get more feedback.
> I have a feeling that infinity is a separate concept orthogonal
> to traversal. But I'm not sure.
>

The above layout is almost orthogonal, with Infinite Forward Sequence
and Finite Forward Sequence serving as "base" concepts related to
Finite / Infinite. I suppose you could have less refined Infinite
Sequence and Finite Sequence concepts, but I'm not sure how useful
they would be (AFAICT, they could only describe `size` and `empty`).

Things aren't perfectly orthogonal because Finite + Bidirectional
require `back`, but Finite + Forward do not, and neither do Infinite +
Bidirectional.

Best,

Stjepan

> Regards,
> --
> Joel de Guzman
> http://www.boostpro.com
> http://spirit.sf.net
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk