Boost logo

Boost :

From: Vesa Karvonen (vesa_karvonen_at_[hidden])
Date: 2002-04-13 08:18:04

Joel de Guzman:
>If knowledge of 'fold' et al is required to write an MPL
>algorithm, then it contradicts its primary goal.

I'm not sure about what you are talking about here. I thought that the goal
of MPL is to facilitate template metaprogramming. One of the things provided
by MPL (in order to facilitate template metaprogramming) is a sequence
abstraction and a set of algorithms (higher order functions) for
manipulating sequences. I don't see how this would contradict the goal of

>Now you are saying that one needs to learn FP (specifically higher
>order functions) to write an MPL algorithm?

No, I don't think that it is strictly necessary to learn about higher order
functions in order to write algoritms using the MPL, but I can't see why
someone would want to waste time writing the same pattern matching +
recursion patterns over and over again.

>I thought that
>the reason why there was the concept of mutators, erase, replace
>etc. was to make it more familiar to the typical STL programmer.

Some of the terminology used in MPL is borrowed from STL, which borrowed
some of the terminology from functional programming languages. AFAIK the
idea is to make it easier for STL programmers to understand MPL. This does
not imply that the MPL primitives would be any less functional.

'erase' and 'replace' are reasonable names for functions in a functional
setting. Even in FP languages some list manipulation functions may have
names that one might confuse to be imperative.

Join the world’s largest e-mail service with MSN Hotmail.

Boost list run by bdawes at, gregod at, cpdaniel at, john at