Re: [fpc-pascal] for .. in loop implementation

2009-01-23 Thread Lee Jenkins
leledumbo wrote: OK, I've read http://wiki.freepascal.org/Modernised_Pascal this (and the FAQ as well). I disagree with any statement saying that for .. in loop is only a type-saver. It's a good language extension and should be included (since Delphi already have this, it will also be a good

Re: [fpc-pascal] for .. in loop implementation [off topic - goto ?]

2009-01-10 Thread Martin Friebe
Vinzent Höfler wrote: Jürgen Hestermann wrote: Mantra: First make it work, then make it fast. In general that's true from the programmer's viewpoint. But this does not apply to adding language details because there is no 'first make it work'. Why obscure important implementation details if

Re: [fpc-pascal] for .. in loop implementation

2009-01-08 Thread Florian Klaempfl
Vinzent Höfler schrieb: Jürgen Hestermann wrote: Mantra: First make it work, then make it fast. In general that's true from the programmer's viewpoint. But this does not apply to adding language details because there is no 'first make it work'. Why obscure important implementation details

Re: [fpc-pascal] for .. in loop implementation

2009-01-08 Thread Jeremy Cowgar
Marco van de Voort wrote: In our previous episode, leledumbo said: The latter one has iteration overheads, while the former can be optimized to loop as many as needed. I'm not saying I'm the best Pascal programmer, but in case there's a (better) solution to this (rather than extending the

Re: [fpc-pascal] for .. in loop implementation

2009-01-08 Thread Marco van de Voort
In our previous episode, Jeremy Cowgar said: However IMHO that doesn't meant you are right. One single case of an optimalization advantage, and then in a border case like iteration over a constant set does not justify a language extension. What is the negative of adding it? Clutter,

Re: [fpc-pascal] for .. in loop implementation

2009-01-08 Thread Jürgen Hestermann
Vinzent Höfler schrieb: I won't judge on the only save some writing here, but generally it *does* apply to language features: If a particular language feature helps you writing correct code faster (by supporting you to make it work instead of relying on your abilities to use the debugger),

Re: [fpc-pascal] for .. in loop implementation

2009-01-08 Thread Jonas Maebe
On 08 Jan 2009, at 19:01, Jürgen Hestermann wrote: I doubt that. I often stumble over programs which are awfully slow (Novell Salvage Dialog for examples sometines needs many minutes to sort 80 objects!). And that compared with the everywhere heard statement You don't need to think about

[fpc-pascal] for .. in loop implementation

2009-01-07 Thread leledumbo
OK, I've read http://wiki.freepascal.org/Modernised_Pascal this (and the FAQ as well). I disagree with any statement saying that for .. in loop is only a type-saver. It's a good language extension and should be included (since Delphi already have this, it will also be a good idea). Consider the

Re: [fpc-pascal] for .. in loop implementation

2009-01-07 Thread Marco van de Voort
In our previous episode, leledumbo said: The latter one has iteration overheads, while the former can be optimized to loop as many as needed. I'm not saying I'm the best Pascal programmer, but in case there's a (better) solution to this (rather than extending the language) please tell me.

Re: [fpc-pascal] for .. in loop implementation

2009-01-07 Thread Vincent Snijders
leledumbo schreef: OK, I've read http://wiki.freepascal.org/Modernised_Pascal this (and the FAQ as well). I disagree with any statement saying that for .. in loop is only a type-saver. It's a good language extension and should be included (since Delphi already have this, it will also be a good

Re: [fpc-pascal] for .. in loop implementation

2009-01-07 Thread Jürgen Hestermann
I disagree with any statement saying that for .. in loop is only a type-saver. It's a good language extension and should be included (since Delphi already have this, it will also be a good idea). Consider the following example: for d in [Monday,Wednesday,Friday] do ; // versus for

Re: [fpc-pascal] for .. in loop implementation

2009-01-07 Thread Vinzent Höfler
Jürgen Hestermann wrote: I disagree with any statement saying that for .. in loop is only a type-saver. It's a good language extension and should be included (since Delphi already have this, it will also be a good idea). Consider the following example: for d in [Monday,Wednesday,Friday] do ;

Re: [fpc-pascal] for .. in loop implementation

2009-01-07 Thread dmitry boyarintsev
the nice thing about pascal, is that compile support different code compilers syntax: {$mode ...} if anyone likes, he/she can implement additional {$mode} for the compiler, right? this new {$mode} can be included into compiler packages, and if necesssary anyone can rebuild the compiler to support

Re: [fpc-pascal] for .. in loop implementation

2009-01-07 Thread Jürgen Hestermann
P.S. Honestly, Pascal (and especially ObjectPascal) already hides quite some stuff from the programmer. Properties, for example, can hide potentially costly procedure calls in simple assignment statements. That's true. But I am not happy about that approach. In the last years lots of things

Re: [fpc-pascal] for .. in loop implementation

2009-01-07 Thread Vinzent Höfler
Jürgen Hestermann wrote: Mantra: First make it work, then make it fast. In general that's true from the programmer's viewpoint. But this does not apply to adding language details because there is no 'first make it work'. Why obscure important implementation details if the only benefit is