V2 string

James Dennett jdennett at acm.org
Fri Jul 6 18:25:49 PDT 2007


Walter Bright wrote:
> James Dennett wrote:
>> I've found many times when the difference between an empty
>> string and no string was important; they generally have
>> nothing to do with extending at all.  I'd be interested to
>> know why you assert that no such cases exist.
> 
> I'd like to know of such cases.

Any time you need a difference between "specified, and
known to be empty" and "unspecified or unknown", which
is very common.  The alternative is to carry a boolean
around to say whether the string is in use.

Others have raised the case of null meaning "use default"
(but let's not spend too much time on that specific case),
and the fact that the database world often (though not
always) distinguishes null from empty.  Many people have
found good reason to do this.  The "Maybe" or "Fallible"
type constructors used in other languages also cover cases
where "absent" can usefully be handled separately from
"empty" (in more general cases than just strings).

-- James



More information about the Digitalmars-d mailing list