"bstring"

Justin Spahr-Summers Justin.SpahrSummers at gmail.com
Mon Apr 5 19:22:35 PDT 2010


On Mon, 5 Apr 2010 18:48:58 -0400, Michel Fortin 
<michel.fortin at michelf.com> wrote:
> 
> Lately I've been using the type "immutable(ubyte)[]" a lot to pass 
> around binary data of various kinds. In a couple of places now, to save 
> some typing, I'm using this alias:
> 
> 	alias immutable(ubyte)[] bstring;
> 
> Would that make a worthy addition to the other standard string formats 
> defined in object.o? Or am I the only one who is using this type a lot?

I use it quite a lot too, but I'm not sure if making it (effectively) a 
language keyword is the right approach. I mean, I use mutable byte 
strings probably just as often. The fact that ubytes are really just 
arbitrary data I think somewhat diminishes the usefulness of a keyword; 
to compare, 'string' to me represents a contiguous run of valid 
*characters* (i.e., the data has meaning and representation in and of 
itself)... not strictly enforced by D, of course, but that's how the 
type is used.

Apologies if this came out rather disjointed.



More information about the Digitalmars-d mailing list