Checking if a string is null

Bruno Medeiros brunodomedeiros+spam at com.gmail
Mon Jul 30 03:38:23 PDT 2007


Manfred Nowak wrote:
> Bruno Medeiros wrote
> 
>> I dont' get it, in D's arrays, what are the neutral elements 0 and
>> 1? A zero length, and a one-length array, respectively? Or
>> something else? And how can there be two different neutral
>> elements? 
> 
> Please read here for a first impression: 
> http://en.wikipedia.org/wiki/Kleene_algebra
> 
> Then notice, that D at least implicitely has the `+'-operator. It shows 
> up in overloading. Therefore a 0 is needed.
> 
> There seem to be a consensus in the particpants of this thread that the 
> 1 in D's arrays is the array with length zero.
> 
> -manfred

Ok, I should have read about Kleene Algebra first, but I got thrown of 
by your sequence of replies.
I asked why would you in the first place want to have arrays be monoids 
with regards to the identity operation (which I have pointed is not useful).
You replied it was "Because arrays should approximately form a 
mathematical Kleene Algebra at the semantical level."
That seems like a vague answer. I can only reply, then why would you 
want arrays to form a Kleene Algebra?

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



More information about the Digitalmars-d mailing list