Re: pseudo-specs for a String class

From: Kinkie <gkinkie_at_gmail.com>
Date: Wed, 27 Aug 2008 11:10:06 +0200

> In any case, I agree with the general model of:
>
> * Memory: some chunk of contiguous memory somewhere;
> * MemoryRegion: some reference to { Memory, offset, length }
> * String: a MemoryRegion and some routines to manipulate it

I'm unconvinced. What's the purpose of a MemoryRegion if you can't
manipulate it?
In C, it makes sense to provide different API: strings provide
different semantics than char* (they're null-terminated).

But here?
Everything is bounds-safe or it's not worth the effort.
NULL-termination is optional and only used when exporting the
underlying data..

I'm being very pragmatic here: if it behaves like a string, it is a
string, despite the fact that it might actually be a buffer, or a
blob.

-- 
 /kinkie
Received on Wed Aug 27 2008 - 09:17:57 MDT

This archive was generated by hypermail 2.2.0 : Thu Aug 28 2008 - 12:00:08 MDT