Path: utzoo!mnetor!uunet!mcvax!diku!daimi!erja From: erja@daimi.UUCP (Erik Jacobsen) Newsgroups: comp.lang.misc Subject: Re: From Modula to Oberon Message-ID: <1345@daimi.UUCP> Date: 4 Mar 88 09:30:16 GMT References: <7161@sol.ARPA> <2787@enea.se> Reply-To: erja@daimi.UUCP (Erik Jacobsen) Organization: DAIMI: Computer Science Department, Aarhus University, Denmark Lines: 28 Keywords: FOR In <2787@enea.se> Erland Sommarskog (sommar@enea.se) makes many good points about Wirth's new language, Oberon, but also deplores the removed FOR-loop. He gives an example, and writes: > ... (OK, > depends on how FOR is implemented ... That is in fact the problem with FOR-loops - at least as they exist today. At one time I had access to 5 different PASCAL-compilers, and could write a program with one FOR-loop, that would give 4 different results when executed, and one that wouldn't compile. This problem does not exist with WHILE/REPEAT-loops, and removing the FOR-loop from a language is one effective way of making it cleaner. Another way is to define what the FOR-loop actually means in one particular language, and today there is a PASCAL-standard. But we still have old compilers, and we have FOR-loops in other languages, that look the same, but behave differently. If you write programs for portability, you must know what subset of valid FOR-loops will compile and execute correctly in all implementations of the langauge (and possibly in other languages), and otherwise use WHILE/REPEAT-loops.