[LispM-Hackers] C++ questions

James A. Crippen james@UnLambda.COM
Tue, 10 Apr 2001 14:58:14 -0800 (AKDT)


Some questions regarding what level of the language to use...

I'm all in favor (as you may no doubt have guessed by now) of using
features of C++ that are defined in the language itself.  But should we
ever touch anything else defined in the standard?  Specifically, should we
use something like <list> from the STL?  Should we use <string> instead of
char* if at all possible?

I'm definitely for using something like <string> if people feel
comfortable with the level of support for it across architectures.  I feel
that <string> makes life *much* better than having to deal with char*'s
all day long.  But I'm not so sure about using things like <list>, or for
that matter anything else from the STL.  AFAIK the STL is not well
supported across all platforms.  Certainly it works like a charm under
GCC, but under any other compiler I have very little experience.  I'm sure
it probably works well with M$'s VC++, but what about Sun's compiler?  Or
SGI's?  I have no clue in these cases.

Anyhow, I'd like to use <iostream>, <string>, and a few others not from
the STL.  If people feel okay about using the STL then I'd like to see
<list>, <iterator>, <map>, <queue>, <vector>, and a few others.  I realize
that we can certainly implement our own as well, but that's extra work.

We could also do some fancy compile-time testing to determine whether a
system has sufficient support for such things and use our own supplied
utility classes if the system lacks support.  But I'd rather not do that
if we can get away with it.

I'm spoiled by working with GCC under Linux and BSD so much.  Everything I
want to do just works, and I don't have to fiddle around with
implementation details.  But I've not done much porting of anything
written in C++ to other platforms...

'james

PS: I still say that using try/catch is better than any other solution,
and that we can always wrap it up in a portability class at some later
point.

-- 
James A. Crippen <james@unlambda.com> ,-./-.  Anchorage, Alaska,
Lambda Unlimited: Recursion 'R' Us   |  |/  | USA, 61.2069 N, 149.766 W,
Y = \f.(\x.f(xx)) (\x.f(xx))         |  |\  | Earth, Sol System,
Y(F) = F(Y(F))                        \_,-_/  Milky Way.