Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2006-07-05 01:03:22


Jeff Garland <jeff_at_[hidden]> writes:

> David Abrahams wrote:
>> Jeff Garland <jeff_at_[hidden]> writes:
>>
>>> The fact is, if you look around at the languages people are using
>>> most for string processing, they offer just as many features as
>>> super_string and then some.
>>
>> Try "python -c help(str)"
>
> Looks like I'm still missing a couple functions ;-)

And by the same measure, you have some extras (no regexps in python
strings).

> BTW, Is it true that strings in python are immutable?

Yes it is.

>>> There are plenty of counter examples: Perl,
>>
>> Not sure that's a good example if you're going for readability; Plus,
>> it has special operators that help (and could in principle be
>> implemented as free functions).
>
> I thought the c++ was pretty readable. As for free functions, I'm
> not opposed, but so far I haven't seen a proposal that makes the
> code clearer to my eye.

Well, Shunsuke Sogame's proposed interface (which echoes some work
Eric Niebler has already done) works pretty well. I don't think that
concatenating string operations with '.' is vastly better than using
'|', and the former comes with some attendant disadvantages that have
been detailed elsewhere in this thread.

>>> Java, Javascript, and Ruby that build regex directly into the
>>> library/language.
>>
>> Whoa there. Python builds regex directly into the library too. That
>> doesn't mean it should be part of the string.
>>
>> python -c "import sre;help(sre)"
>
> I wasn't trying to suggest that Python didn't support regex.

Didn't think you were; you seem to be missing my point, which is that
there are lots of ways to get the functionality into the library. It
doesn't necessarily have to be directly attached to the string class.

>>> It's very powerful and useful in my experience. And, of course,
>>> super_string doesn't take away anything, just makes these powerful
>>> tools more accessible and easier to use.
>>
>> I agree with the idea in principle; I just want to scrutinize its
>> execution a bit before we all buy into it as proposed ;-)
>
> How does that phrase go...it'll be a cold summer day in Az (a balmy
> 105 now) before we 'all' agree ;-)

Seems like you're deflecting rather than engaging, which is
disappointing. There are lots of important questions here; I'm glad
you proposed this interface and thereby raised them. I just wish we
could have a more complete exploration of the solution space, which --
especially where C++ is concerned -- is still largely uncharted.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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