1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>Lazy List</title> 5<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="../index.html" title="Chapter 1. Phoenix 3.2.0"> 8<link rel="up" href="../index.html" title="Chapter 1. Phoenix 3.2.0"> 9<link rel="prev" href="examples/transforming_the_expression_tree.html" title="Transforming the Expression Tree"> 10<link rel="next" href="lazy_list/background.html" title="Background"> 11</head> 12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 13<table cellpadding="2" width="100%"><tr> 14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td> 15<td align="center"><a href="../../../../../index.html">Home</a></td> 16<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td> 17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 19<td align="center"><a href="../../../../../more/index.htm">More</a></td> 20</tr></table> 21<hr> 22<div class="spirit-nav"> 23<a accesskey="p" href="examples/transforming_the_expression_tree.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="lazy_list/background.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h2 class="title" style="clear: both"> 27<a name="phoenix.lazy_list"></a><a class="link" href="lazy_list.html" title="Lazy List">Lazy List</a> 28</h2></div></div></div> 29<div class="toc"><dl class="toc"> 30<dt><span class="section"><a href="lazy_list/background.html">Background</a></span></dt> 31<dt><span class="section"><a href="lazy_list/what_is_provided.html">What is provided</a></span></dt> 32<dt><span class="section"><a href="lazy_list/tutorial_with_examples.html">Tutorial with 33 examples</a></span></dt> 34<dd><dl> 35<dt><span class="section"><a href="lazy_list/tutorial_with_examples/arithmetic_functions.html">Arithmetic 36 functions</a></span></dt> 37<dt><span class="section"><a href="lazy_list/tutorial_with_examples/list_generation.html">List 38 Generation</a></span></dt> 39</dl></dd> 40<dt><span class="section"><a href="lazy_list/exceptions.html">Exceptions</a></span></dt> 41<dt><span class="section"><a href="lazy_list/implementation_details.html">Implementation 42 Details</a></span></dt> 43<dt><span class="section"><a href="lazy_list/testing.html">Testing</a></span></dt> 44<dt><span class="section"><a href="lazy_list/where_next_.html">Where Next?</a></span></dt> 45</dl></div> 46<h2> 47<a name="phoenix.lazy_list.h0"></a> 48 <span class="phrase"><a name="phoenix.lazy_list.summary"></a></span><a class="link" href="lazy_list.html#phoenix.lazy_list.summary">Summary</a> 49 </h2> 50<p> 51 Phoenix now has a lazy list implementation which is very similar but not identical 52 to the implementation provided by <a href="http://cgi.di.uoa.gr/~smaragd/fc++/" target="_top">FC++</a>. 53 This provides a set of objects defined by list<type>, for example this 54 which defines an empty list of type int. 55 </p> 56<pre class="programlisting"><span class="identifier">list</span><span class="special"><</span><span class="keyword">int</span><span class="special">></span> <span class="identifier">example</span><span class="special">;</span> 57</pre> 58<p> 59 A list can contain zero or more elements of the same type. It can also be declared 60 using a function returning values of the correct type. Such lists are only 61 evaluated on demand. A set of functions are defined which enable many ways 62 of manipulating and using lists. Examples are provided for the features available. 63 </p> 64<p> 65 Exceptions are provided to deal with certain cases and these can be turned 66 off if desired. There is a check on the maximum list length which has a default 67 of 1000 which can be changed by the user. 68 </p> 69<p> 70 This is an extension to Boost Phoenix which does not change the public interface 71 except to define new features in the namespace 72 </p> 73<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">phoenix</span> 74</pre> 75<p> 76 It has to be explicitly included using the header 77 </p> 78<pre class="programlisting"><span class="identifier">boost</span><span class="special">/</span><span class="identifier">phoenix</span><span class="special">/</span><span class="identifier">function</span><span class="special">/</span><span class="identifier">lazy_prelude</span><span class="special">.</span><span class="identifier">hpp</span> 79</pre> 80<h2> 81<a name="phoenix.lazy_list.h1"></a> 82 <span class="phrase"><a name="phoenix.lazy_list.introduction"></a></span><a class="link" href="lazy_list.html#phoenix.lazy_list.introduction">Introduction</a> 83 </h2> 84<p> 85 Boost Phoenix provides many features of functional_programming. One of the 86 things which has been missing until now is a lazy list implementation. One 87 is available in the library <a href="http://cgi.di.uoa.gr/~smaragd/fc++/" target="_top">FC++</a> 88 which although not part of Boost has many similarities. It has been possible 89 to reimplement the strategy of the <a href="http://people.cs.umass.edu/~yannis/fc++/New/new_list_implementation.html" target="_top">FC++ 90 List Implementation</a> using the facilties in Phoenix. This provides something 91 which has up until now not been available anywhere in Phoenix and probably 92 not anywhere else in Boost. This new implementation is very well integrated 93 with other features in Phoenix as it uses the same mechanism. In turn that 94 is well integrated with Boost Function. 95 </p> 96<p> 97 There is a great deal of material in <a href="http://cgi.di.uoa.gr/~smaragd/fc++/" target="_top">FC++</a> 98 and it is not proposed to replicate all of it. A great deal has changed since 99 <a href="http://cgi.di.uoa.gr/~smaragd/fc++/" target="_top">FC++</a> was written and 100 many things are already available in Phoenix or elsewhere. The emphasis here 101 is to add to Phoenix in a way which will make it easier to implement functional_programming. 102 </p> 103<p> 104 Progress is being made in implementing both the basic list<T> and the 105 functions needed to manipulate lists. 106 </p> 107</div> 108<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 109<td align="left"></td> 110<td align="right"><div class="copyright-footer">Copyright © 2002-2005, 2010, 2014, 2015 Joel de Guzman, Dan Marsden, Thomas 111 Heller, John Fletcher<p> 112 Distributed under the Boost Software License, Version 1.0. (See accompanying 113 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 114 </p> 115</div></td> 116</tr></table> 117<hr> 118<div class="spirit-nav"> 119<a accesskey="p" href="examples/transforming_the_expression_tree.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="lazy_list/background.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> 120</div> 121</body> 122</html> 123