[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ STL

From: Eric E Moore
Subject: Re: C++ STL
Date: Mon, 24 Jun 2002 19:37:02 +0100
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.2

"Maurício" <address@hidden> writes:

>     Hi,
>     I've learned a little about guile, and it ocurred to me that
> porting the C++ Standard Template Library to guile could be
> interesting. We could, for instance, define several operations a
> given type of iterator or generator should supply, and then all
> algorithms (copy, merge, sort, transform etc.)  using those would be
> readily available. Since guile has support for functional style, I
> think those algothims could be even more general than they are in
> C++. Has anyone tried that already?

Not the whole STL, but good chunks of it.  For example we already have
a generic singly linked list type, with sort (sort), merge (merge),
copy (list-copy), transform (map) etc.  operations defined on it.
Similarly we have some functions for operating on tree structures
(built as lists of lists).  We have a (non-resizing) vector type,
which is less supported than the others, but at least can be sorted,
and supports a transform operation (of sorts).

The way that variable access works in scheme means that iterators and
much of the rest of the STL aren't especially needed.

It might be worth generalizing some of the functions, but most
schemers tend to use the list-based ones most of the time, which are
quite good.

Eric E. Moore

Attachment: pgprWqpoGgrQP.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]