Checking if a string is null

Manfred Nowak svv1999 at hotmail.com
Thu Jul 26 13:41:51 PDT 2007


Bruno Medeiros wrote

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

>From your signature follows that you might at least understand the 
theoretical background.


The mathematical equality relation `=' is a special case of the 
mathematical equivalence relation `~' in that "two mathematical 
objects are equal if and only if they are precisely the same in every 
way" [cited from wikipedia].

I.e. in D the mathematical equality relation is bound to the 
identityExpression and restricted to arrays containing at least one 
element.


To D's equalityExpression only a mathematical equivalence relation is 
bound and also restricted to arrays containing at least one element, 
as one can see from the definition:

| For static and dynamic arrays, equality is defined as the lengths
| of the arrays matching, and all the elements are equal.

I.e. for two arrays `a' and `b' declared as `T[] a, b;' for some type 
`T' having at least one element each, holds:
   if `a is b' then `a == b'
But the other direction is not necessarily true.   



BTW: D is starting to become _equivalent_ to the tower of Babel 
because its main architect has declared:
  D "is not governed by [...] any overarching theory of programming."

This thread shows that at least some have built their own models of 
D, incompatible to each others models of D.

-manfred 



More information about the Digitalmars-d mailing list