Checking if a string is null

Bruno Medeiros brunodomedeiros+spam at com.gmail
Thu Jul 26 10:56:01 PDT 2007


Manfred Nowak wrote:
> Bruno Medeiros wrote
> 
>> It's in
>> http://www.digitalmars.com/d/expression.html#IdentityExpression
>> "For static and dynamic arrays, identity is defined as referring
>> to the same array elements"
> 
> From the specs:
> | Concatenation always creates a copy of its operands, even if one
> | of the operands is a 0 length array 
> 
> I believe that these definitions are essential for solving the 
> dectected ambiguities.
> 
> Their meaning is, that arrays together with the concatenation 
> operation do not form the mathematical structure of a monoid, because 
> there is no identity preserving element for arrays under the 
> concatenation operation.
> 
> Moreover: concatenation is not associative either because identity is 
> defined only for arrays containing elements, i.e. two arrays with a 
> length of zero might not be identical.
> 

Monoids and other common mathematical structures do not have the notion 
of computer-science identity, only equality (which they may call 
identity, but it's the same as equality in a programming languages context).


-- 
Bruno Medeiros - MSc in CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d mailing list