Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2002-01-21 16:39:53


On Monday 21 January 2002 04:16 pm, you wrote:
> What about the following:
>
> HEAD -> FIRST (first element of the list)
> TAIL -> REST (all but first ...)
>
> TAKE -> FIRST_N (first n elements ...)
> DROP -> REST_N (all but first n elements)

Okay by me.

> "transform" (= "map" in several FP languages) is already used and it
> is a close parallel of the STL "transform". Yes, "fold" doesn't sound
> like STL, but I don't like "accumulate", which is the STL equivalent.

"accumulate" is a poor name for sure; I'll go add "fold" to my vocabulary :)

> I think this would be nice, because BOOST_PP_TUPLE_ELEM() is the
> single most heavily used function of the preprocessor library.
> Actually, I'd like to hear if someone can suggest an even shorter,
> but at least as intuitive, mnemonic than ELEM.

BOOST_PP_(TUPLE_?)AT?

> So, here is the naming as I currently find best:
> - short enough (to reduce readability problems in PP metacode)
> - as close to STL as possible, but not too close

It seems that by dropping the prefixes it will become very hard to read PP
metacode, because there is no cue regarding the data structure. We only get
away with short, nondescriptive names in other languages because the type
system gives us some clue.

        Doug


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