Boost logo

Boost :

From: joel de guzman (djowel_at_[hidden])
Date: 2002-04-13 06:16:45


----- Original Message -----
From: "Vesa Karvonen" :

> Aleksey Gurtovoy:
> >Joel de Guzman:
> > > > Are you familiar with functional programming?
> > >
> > > What's the point of this question? To gauge my level of competence
> > > to form an opinion?
> >
> >No, not at all. I just didn't want to reveal the second question
> >before you answer the first one :). The argument about "simplicity" of
> >pattern-matching-self-recursive-partial-specialized 'count_if'
> >implementation is partially built around the assumption that it's easy
> >to understand for somebody with functional programming background. To
> >me, functional programming primitives like 'fold' et al. seem much
> >more important concepts than any esoteric low-level patterns matching.
>
> FWIW, IMO, Aleksey is right here, and people who don't understand the
> purpose of higher order sequence manipulation functions should really read
> some book on functional programming.
>
> I have been programming in Ocaml for the past 7 months. During that time, I
> seem to have written one higher order function that used pattern matching
> and recursion on lists. That particular function isn't used in the current
> code base. On the other hand, I've used standard library higher order
> functions like map, fold_left & iter hundreds of times.
>
> If you look at a text book on functional programming, you will find that
> pattern matching (on lists) and primitive recursion are typically presented
> before higher order library functions for list manipulation. This is for
> pedagogical reasons. Browsing later chapters of the book, you will find that
> it will use more and more higher order functions rather than pattern
> matching and primitive recursion.

First of all, I *DO* know about 'fold' et al. But that's *NOT* the issue.
If knowledge of 'fold' et al is required to write an MPL algorithm,
then it contradicts its primary goal. 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. Now you
are saying that one needs to learn FP (specifically higher order
functions) to write an MPL algorithm?

I really, really rest my case, I simply don't get it. Color me
befuddled :(

Cheers,
--Joel


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