Re: pseudo-specs for a String class

From: Henrik Nordstrom <henrik_at_henriknordstrom.net>
Date: Wed, 27 Aug 2008 20:04:33 +0200

ons 2008-08-27 klockan 11:10 +0200 skrev Kinkie:

> I'm unconvinced. What's the purpose of a MemoryRegion if you can't
> manipulate it?

You can manipulate it, but at a rather low level. You can also append to
it by adding a MemoryRegion (or String), you can access raw octets. But
you can't do any fancier string family operations such as tokenising
based on separators, case-insensitive compare, substring search, etc...

a MemoryRegion is binary data.

a String is character data.

> 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..

Strings have character properties. MemoryRegions not.

Regards
Henrik
Received on Wed Aug 27 2008 - 18:04:32 MDT

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