[fpc-pascal] for..in loops?

Marco van de Voort marcov at stack.nl
Sat Nov 19 16:49:47 CET 2005


> On Fri, 18 Nov 2005 13:18:40 -0800 (PST)
> Alan Mead <cubrewer at yahoo.com> wrote:
> 
> > fpc 2.0.0 doesn't compile this... are "for..in" loops in a newer
> > version or will they be sometime soon?  Here is a little blurb about
> 
> FPC will never support this, AFAIK. It doesn't really add anything new, it
> just shortens the code somewhat. Only in toy examples is it nice, in
> practice it doesn't really matter. We should try to keep the language as
> small and clean as possible.

Note that part of this is quite elegant on .NET since basically is an
object, and so everything can support some iterator interface, and the JIT
can optimize a lot overhead away.

It doesn't work that way in native, and needs lots of expensive helpers, iow
supporting it is a hack. Note that Perl is also OOP to a higher degree with
JIT.

This is the problem with a lot of new Delphi.NET syntax. It might be
backportable to native, but it feels "odd". The .NET generics have similar
issues.



More information about the fpc-pascal mailing list