On Tue, 22 Jan 2013 09:20:28 +0100
Bart <bartjun...@gmail.com> wrote:

> On 1/21/13, Mattias Gaertner <nc-gaert...@netcologne.de> wrote:
> 
> 
> > The lower-than and greater-than operators are defined for
> > strings. Do you want to remove them too?
> >
> >
> >> Ranges for strings are (countably) infinite, and this is (by design)
> >> not the case in the case of other cases (pun intended).
> 
> No, you are missing the analogy I meant (or I did not make myself clear 
> enough).
> 
> Case was originally meant for Ordinal values.
> With Ordinal values ranges (1..100, 'a'..'z') are never infinite.
> Pascal has never had the concept of ranges (in this sense) that are
> infinite (countable or uncoutable).
> You cannot define ranges for Floats (they would be uncoutable
> infinite), and by that analogy I would suggest you should not be able
> to define ranges for strings, as they are (coutbale) infinite.
> 
> The ability to have an infinite (countable or uncoutable) "range"
> between two values for a given type however, does not mean you should
> not have lesser than, or greater than operators. If this were the case
> we'ld have to remove them for floats as well, and that would be rather
> silly.
> 
> So my analogy was more with floats (but they have uncoutable infinite
> ranges, as opposed to coutable infinity for strings).

To implement a case LowerBound..UpperBound you only need a transitive
compare operator. You don't need fixed size ranges. 
If you have small fixed size range then you can implement the case
via jump tables. But that is only an implementation detail.

IMHO if you think that the string compare operator makes sense, then
strings in case makes sense too. They make exactly the same sense.

Mattias

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to