Boost logo

Boost :

Subject: Re: [boost] [string] proposal
From: Dean Michael Berris (mikhailberis_at_[hidden])
Date: 2011-01-28 15:54:34


On Sat, Jan 29, 2011 at 4:24 AM, Joe Mucchiello <jmucchiello_at_[hidden]> wrote:
> On Jan 28, 2011, at 12:59 PM, Dean Michael Berris wrote:
>>
>> And I stopped before I write too much -- the initial version is
>> already up:
>>https://github.com/downloads/mikhailberis/cpp-string-theory/cpp-string-theory.pdf
>>
>>
>> -- I'll give it more information and the actual interfaces and
>> implementation as soon as I get some Z's. :)
>>
>
> Hi, I have a question. You keep saying that the string (or chain) has no
> encoding the string is "just a sequence of bytes" but that doesn't make sense.
> The bytes have to have some form of encoding otherwise how do the adapter
> classes know how to convert the sequence of bytes into an encoded
> sequence?

The adapters assume -- and a validating algorithm does the validation.
This makes adapters/views remain efficient in implementation, while
putting validation as an explicit independent algorithm dependent on
the desired encoding.

> When you say the string has no encoding do you simply mean
> the default encoding is implementation dependent? Did I miss where you
> said this somewhere?
>

I mean strings by themselves as a storage data structure have no
intrinsic encoding. Now if you want to build strings of a certain
encoding -- as in the byte-level encoding -- you use a builder that
knows how to do the appropriate encoding. If you take a string and
want to implement it, you compose an interpretation of the string
using a view.

I haven't pointed out the view aspect yet since I'm focusing the
document on the immutable string first. I see the encoding issue as
largely a different problem that is solvable using appropriate views
and algorithms that operate on the appropriate abstractions at a
different level.

> Oh, and I see the value in an immutable string. I just think you are still at
> such a high level that it's hard to see where you are going for some people.
>

Yeah, and the document after all is an initial draft anyway, it's only
going to get longer and more explicit as it goes.

Thanks for the questions/feedback, I hope this helps.

PS. so much for Z's LOL

-- 
Dean Michael Berris
about.me/deanberris

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