[Tutor] modifying array during 'for' loop?
Thu, 3 Feb 2000 18:29:31 -0500 (EST)
-----BEGIN PGP SIGNED MESSAGE-----
I was just wondering if it is always okay to modify the array you are
looping through with a for loop (i.e. modify the array -during- the
for loop). Is it okay to delete the current item from the list? what
about items other than the current item? What about append items to
the end of the array, or slice the array?
I'm dealing with lists (scalar arrays) and tuples. If I'm not being
clear, I would be happy to provide example code.
While I'm on the topic, I have always assumed that a tuple is
marginally more efficient than a list. Is this true?
Thanks in advance,
Neil Conway <firstname.lastname@example.org>
Get my GnuPG key from: http://klamath.dyndns.org/mykey.asc
In the beginning the Universe was created. This has
made a lot of people very angry and been widely
regarded as a bad move.
-- Douglas Adams
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.1 (FreeBSD)
Comment: Processed by Mailcrypt 3.5.5 and Gnu Privacy Guard <http://www.gnupg.org/>
-----END PGP SIGNATURE-----