[fpc-devel] New feature discussion: for-in loop

"Vinzent Höfler" JeLlyFish.software at gmx.net
Wed Oct 21 00:47:02 CEST 2009


-------- Original-Nachricht --------
> Datum: Tue, 20 Oct 2009 13:38:40 +0200
> Von: Micha Nelissen <micha at neli.hopto.org>
> An: FPC developers\' list <fpc-devel at lists.freepascal.org>
> Betreff: Re: [fpc-devel] New feature discussion: for-in loop

> Vinzent Höfler wrote:
> > Marc Weustink <marc.weustink at cuperus.nl>:
> >> loop you are not allowed to modify the loop variable. In this case I
> >> can 
> >> imagine its not allowed to modify the list.
> > 
> > But how's the compiler supposed to know which method modifies MyList and
> which one does not? 
> 
> That's why I suggested the use of 'const functions' in other message in 
> this thread.

Yes, I read that later on. Is that implemented in FPC? Actually I read of that feature the first time, but I like it already. ;) In that case this part of my argument may be ignored, of course. OTOH I've never stumbled upon source code using it, so it may seem not widespread enough yet to be useable (basic iterable classes like TList spring to mind)...?

(Currently, I'm reading my mails online, so I answer one at a time at the risk of repeating somebody else's argument. Sorry if that causes inconviniences.)


Vinzent.

-- 
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser



More information about the fpc-devel mailing list