A Standard

Jay O'Connor joconnor at nets.com
Sun May 25 20:34:24 EDT 2003


In article <3ED14F38.1227F8B9 at alcyone.com>, "Erik Max Francis"
<max at alcyone.com> wrote:

>> Luis Cortes wrote:
> 
>>  I have long been playing the idea ( and I'm sure that others have
>> too -- of
>>  porting the STL library from C++ completely re-written in python.  I
>>  have had great success in doing this with the the vector class with
>> little
>>  problem (although it did take me several iterations).  I believe it
>>  would be trivial to finish the rest of the lib.  My question would
>> be,
>>  won't this be better than making our own version of set, list,
>> vector,
>>  map, etc.???
> 
> Well, Python 2.3 comes with builtin sets, lists, and maps (called
> dictionaries), so right out of the gate you're considering duplicating
> things.  If, as you say, reimplementing C++SL-like constructs in Python
> is "trivial" (which is probably not a huge exaggeration, since Python
> comes with the intrusive parts already built in), what is the benefit in
> doing so?

I once was working on a port of Smalltalk's collection classes, arguably
more powerful thath the STD amd closer in line with Python's object
model.

It ended up not being with the effort, the benefit was not worth the size
and it was better to stay within the Python mindset and extend the built
in collections rather than create a whole new infrastructure

I did have some pretty useful Stream classes based on Smalltalk streams,
though, which while not as convenient as iterators, I think were more
flexible
 
>> This way, won't C++ programmers have an easier time crossing over?
> 
> Perhaps, but I don't think that's a very strong motivation for adding
> something to Python.

Amazing how many silly things have been done in languages for the sake of
compatibility with C


-- 
Jay O'Connor
http://www.r4h-music.com

"God Himself plays the bass strings first,
when He tunes the soul"




More information about the Python-list mailing list