S
shunsuke
Hi, all.
After combating for a few years,
Oven 1.0, which is a range-based STL algorithm library, has been
released.
Document:
http://p-stade.sourceforge.net/oven/index.html
Download:
http://tinyurl.com/2eooc9
http://sourceforge.net/project/showfiles.php?group_id=141222&package_id=173059
(Oven is a part of pstade package, which is a header-only library
so that you don't need to build it.)
Oven depends on the Boost.Range concepts:
http://www.boost.org/libs/range/doc/range.html
See also "Range Library Proposal":
http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1871.html
Put simply, the Range concept is a pair of "begin" and "end" STL
Iterator.
(std:
air<int*, int*> is actually a conforming Range.)
Once "begin" and "end" Iterators are packed into a Range,
it can compete with list functions which functional languages offer.
You can make an infinite, lazy, filtered, zipped, tokenized, jointed,
concatenated, cycled, reversed, memoized, and even recursive range.
(In fact, Oven aims to port Haskell list functions into C++.)
An example "Infinite sequence of factorials":
namespace lambda = boost::lambda;
using namespace pstade:
ven;
void test()
{
BOOST_AUTO(factorials,
expression(counting(1, max_count)|scanned(1,
regular(lambda::_1 * lambda::_2))) );
int const answer[] = { 1,1,2,6,24,120,720,5040,40320,362880 };
BOOST_CHECK( equals(factorials|taken(10), answer) );
}
Note that this (nearly)infinite sequence is in essence based only on
Iterator concepts, with which we are familiar for years.
Enjoy Range programming!
Regards,
After combating for a few years,
Oven 1.0, which is a range-based STL algorithm library, has been
released.
Document:
http://p-stade.sourceforge.net/oven/index.html
Download:
http://tinyurl.com/2eooc9
http://sourceforge.net/project/showfiles.php?group_id=141222&package_id=173059
(Oven is a part of pstade package, which is a header-only library
so that you don't need to build it.)
Oven depends on the Boost.Range concepts:
http://www.boost.org/libs/range/doc/range.html
See also "Range Library Proposal":
http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1871.html
Put simply, the Range concept is a pair of "begin" and "end" STL
Iterator.
(std:
Once "begin" and "end" Iterators are packed into a Range,
it can compete with list functions which functional languages offer.
You can make an infinite, lazy, filtered, zipped, tokenized, jointed,
concatenated, cycled, reversed, memoized, and even recursive range.
(In fact, Oven aims to port Haskell list functions into C++.)
An example "Infinite sequence of factorials":
namespace lambda = boost::lambda;
using namespace pstade:
void test()
{
BOOST_AUTO(factorials,
expression(counting(1, max_count)|scanned(1,
regular(lambda::_1 * lambda::_2))) );
int const answer[] = { 1,1,2,6,24,120,720,5040,40320,362880 };
BOOST_CHECK( equals(factorials|taken(10), answer) );
}
Note that this (nearly)infinite sequence is in essence based only on
Iterator concepts, with which we are familiar for years.
Enjoy Range programming!
Regards,