Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2003-10-21 08:23:10

"David Abrahams" <dave_at_[hidden]> wrote in message
> "Thorsten Ottosen" <nesotto_at_[hidden]> writes:
> > As I said in my other post:
> >
> > php: trim() does not modify the original.
> > python: strip() does not modify the original
> > java: trim() : does not modify the original ( even though it's a
> > function; there's no equivalent in StringBuffer )
> > eiffel: prune() : mutates (member function)
> > perl: chomp: mutates
> >
> > I wouldn't say all languages agree. In java you can actually get the
> > pointer in some cases, so you will end up
> > referencing the original. Some of the languages are probably not
> > enough to do what Pavol tried to do, so
> > their design seems more like a *coincidence*, not a design.
> I don't think the fact that Python has immutable strings and Perl
> mutates is coincidence. It reflects fundamentals of their design
> philosophies.

Ok, let's say somebody wrote a custom string class in Python. Would it be
to make both a mutable and non-mutable version of trim for that string? Or
you be forced to make a certain design?


Boost list run by bdawes at, gregod at, cpdaniel at, john at