[fpc-devel] for-in-index loop

Mark Morgan Lloyd markMLl.fpc-devel at telemetry.co.uk
Fri Jan 25 21:10:25 CET 2013


Sven Barth wrote:

> Languages evolve. Natural languages as well as programming languages. We 
> might not agree with every change (e.g. in German there has been 
> established the nasty habit of saying "that makes sense" ("das macht 
> Sinn") while the correct equivalent would be "that has sense" ("das hat 
> Sinn") or "that is sensful" ("das ist sinnvoll")), but we can not stop 
> this evolution. Languages that don't evolve are dead, because noone 
> speaks them anymore (as everyone will always add his one character to 
> the language, though granted this is not as easy for programming 
> languages as you need to work in the compiler/interpreter). Hadn't 
> Borland decided to bring out Delphi and thus the completely different 
> object model (which I personally think is in most points superior to TP 
> style objects, to those have their pros, too), but instead kept e.g. 
> Turbo Pascal for Windows we might not be talking together here today.

I'm not sure that I should venture an opinion, since my ability to 
implement something- to "practice what I preach"- is limited due to my 
position on the learning curve.

However, I'd suggest that there are two possible category of extension: 
those that implement a clearly-delimited first-class object with 
interesting properties, and those that don't.

Something like a <generic>, or a /regular expression/ (borrowing from 
Perl), or a [list of elements] fall into the first category, and should 
be comparatively easy to add to a language- and for a user to ignore if 
he doesn't like them.

Something like

 >>>>    for a in a index i do

falls squarely into the latter category: it's messy to parse, worse to 
read, and is completely unlike any existing language idioms.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-devel mailing list