
Hello, I just noticed `repetitive_view` in boost/fusion/view. It doesn't appear to be documented, but judging from the test, it appears that repetitive_view<Sequence> is an infinite repetition of the elements of the sequence. Is that correct? I would find this extremely useful, but I'm slightly put off by the lack of documentation and the fact that it results in a (not currently officially supported?) infinite sequence. What is the status of repetitive_view? Is it safe to use? Stjepan P.S. we have discussed infinite sequences before: http://archives.free.net.ph/message/20080716.025311.1b54b65e.da.html

Stjepan Rajko wrote:
Hello,
I just noticed `repetitive_view` in boost/fusion/view. It doesn't appear to be documented, but judging from the test, it appears that repetitive_view<Sequence> is an infinite repetition of the elements of the sequence. Is that correct?
I would find this extremely useful, but I'm slightly put off by the lack of documentation and the fact that it results in a (not currently officially supported?) infinite sequence.
What is the status of repetitive_view? Is it safe to use?
Stjepan
P.S. we have discussed infinite sequences before:
http://archives.free.net.ph/message/20080716.025311.1b54b65e.da.html
That is Dan's baby. You should probably ask him. I think a reason why it's undocumented is that the basic concepts of a "sequence" requires a size. An infinite view does not have a size. We'll have to refine the concepts to take in infinite views. I do like your lazy_sequence idea. Please coordinate with Dan on how to proceed with these infinite views. Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net

On Sat, Apr 11, 2009 at 5:53 PM, Joel de Guzman <joel@boost-consulting.com> wrote:
Stjepan Rajko wrote:
Hello,
I just noticed `repetitive_view` in boost/fusion/view. It doesn't appear to be documented, but judging from the test, it appears that repetitive_view<Sequence> is an infinite repetition of the elements of the sequence. Is that correct?
That is Dan's baby. You should probably ask him. I think a reason why it's undocumented is that the basic concepts of a "sequence" requires a size. An infinite view does not have a size. We'll have to refine the concepts to take in infinite views. I do like your lazy_sequence idea. Please coordinate with Dan on how to proceed with these infinite views.
OK, I'll contact Dan. I haven't worked any further on the lazy_sequence idea. I took Steven's suggestion from the end of the thread and just used a transform from mpl::range_c<int, 0, N> instead. But after using that a few times, I found that at least adding some syntactic sugar would be beneficial. So maybe providing lazy_sequence as a thin wrapper around a transform from mpl::range_c<int, 0, N> would be the way to go. And maybe the default value for N is the maximum possible, and an "infinite" sequence is just a finite sequence with maximum possible size (that can be held by int)? Best, Stjepan

Stjepan Rajko wrote:
On Sat, Apr 11, 2009 at 5:53 PM, Joel de Guzman <joel@boost-consulting.com> wrote:
Stjepan Rajko wrote:
Hello,
I just noticed `repetitive_view` in boost/fusion/view. It doesn't appear to be documented, but judging from the test, it appears that repetitive_view<Sequence> is an infinite repetition of the elements of the sequence. Is that correct?
That is Dan's baby. You should probably ask him. I think a reason why it's undocumented is that the basic concepts of a "sequence" requires a size. An infinite view does not have a size. We'll have to refine the concepts to take in infinite views. I do like your lazy_sequence idea. Please coordinate with Dan on how to proceed with these infinite views.
OK, I'll contact Dan.
I haven't worked any further on the lazy_sequence idea. I took Steven's suggestion from the end of the thread and just used a transform from mpl::range_c<int, 0, N> instead. But after using that a few times, I found that at least adding some syntactic sugar would be beneficial. So maybe providing lazy_sequence as a thin wrapper around a transform from mpl::range_c<int, 0, N> would be the way to go. And maybe the default value for N is the maximum possible, and an "infinite" sequence is just a finite sequence with maximum possible size (that can be held by int)?
Opps, sorry, my bad!!! I should give credit where credit is due and the credit should go to Tobias. He wrote the view, not Dan. Sorry, Tobias. Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net
participants (2)
-
Joel de Guzman
-
Stjepan Rajko