🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #5283

Re: From Modula to Oberon

#5283
From: Wayne A. Christopher
Date: Tue, 15 Mar 1988 08:15
18 lines
866 bytes
In article <2827@enea.se>, sommar@enea.se (Erland Sommarskog) writes:
> ... Ada as I see it have
> the perfect solution: The loop variable is declared in the FOR-
> statement, and is thus not accessible afterwards.

Here's the problem with that construct:  I often write

	for (i = 0; i < max; i++)
		if (something)
			break;
	if (i == max)
		...

If the loop variable is inaccessible outside of the loop there's
no way to tell how it terminated, except by using an extra flag,
which is ugly.

	Wayne
Technical Details
Message-ID: <1557@pasteur.Berkeley.Edu>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pasteur!ic.Berkeley.EDU!faustus
References: <2827@enea.se>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pasteur!ic.Berkeley.EDU!faustus
From: faustus@ic.Berkeley.EDU (Wayne A. Christopher)
Newsgroups: comp.lang.misc
Subject: Re: From Modula to Oberon
Message-ID: <1557@pasteur.Berkeley.Edu>
Date: 15 Mar 88 08:15:22 GMT
References: <2827@enea.se>
Sender: news@pasteur.Berkeley.Edu
Lines: 17