[Lazarus] Easiest way to "case" strings

Alexander Klenin klenin at gmail.com
Sun Mar 22 07:06:32 CET 2009


On Sun, Mar 22, 2009 at 05:36, Hans-Peter Diettrich
<DrDiettrich1 at aol.com> wrote:
> Alexander Klenin schrieb:
> There exist too many options with string comparison. In a table lookup
> the compare method can be supplied by the application, in a case
> statement this would require another syntax extension.

There are also many ways to implement strings and dynamic arrays --
but this did not stopped Object Pascal author from adding them,
and I think he was right, even if some of his design decisions are suboptimal.
This "consider all roads then choose none" approach will, obviously,
never allow you to get anywhere ;-)

> Many Delphi extensions to the Pascal language break fundamental design
> rules. It's bad enough that FPC (and Lazarus) has to support such
> aberrations for compatibility reasons,

I agree that some extensions were suboptimally designed, in particular
dynamic arrays,
but "aberrations"? Can you give an example?

> but further extensions should be added very carefully,

Yes, but still they should be added -- that was my point.

> taking into account the design and experiences
> with the successor languages (Modula, Oberon...).

While I deeply respect Wirth's contributions to programming language design,
I think Modula and especially Oberon are not the best sources for inspiration.
Object Pascal has log ago taken different direction -- for example,
if we "take into account" Oberon, then we should, as a first step,
remove strings, classes, virtual functions and "for" loop.
I do not think this is a good way to evolve FPC ;-)

-- 
Alexander S. Klenin



More information about the Lazarus mailing list