🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.vhdl
Article #384

Use of the 'next' statement

#384
From: Peter Ashenden
Date: Thu, 20 Jun 1991 08:25
49 lines
1876 bytes
Here's a question for all you model writers out there.  In what
circumstances have you used the 'next' statement.  I'm having difficulty
thinking up a realistic example of 'nexting' an outer loop from within
an inner loop.

I can see how you could use a next statement in the case of a single
loop.  If you start with

	loop
	  ...
	  if condition then
	    ...
	  end if;
	end loop;

This is equivalent to

	loop
	  ...
	  next when not condition;
	  ...
	end loop;

So using the next statement is quite structured here (in the sense of
structured programming).  However, a pair of nested loops of the form

	outer : loop
	  ...
	  inner : loop
	    ...
	    next outer when condition;
	    ...
	  end loop inner;
	  ...
	end loop outer;

doesn't transform using the conventional structured programming repertoire.

My question is: Is this a realistic thing to want to do anyway?  What
are some examples?  Would the code be clearer if it was rewritten
somehow without the next statement?  Am I missing something obvious?

Responses gratefully received.  Thanks.

PA

----------------------------------------------------------------
Peter J. Ashenden
Dept. Computer Science, University of Adelaide, South Australia
Technical Details
Message-ID: <3746@sirius.ucs.adelaide.edu.au>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!spool.mu.edu!olivea!uunet!munnari.oz.au!yoyo.aarnet.edu.au!sirius.ucs.adelaide.edu.au!chook.adelaide.edu.au!petera

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!spool.mu.edu!olivea!uunet!munnari.oz.au!yoyo.aarnet.edu.au!sirius.ucs.adelaide.edu.au!chook.adelaide.edu.au!petera
From: petera@chook.adelaide.edu.au (Peter Ashenden)
Newsgroups: comp.lang.vhdl
Subject: Use of the 'next' statement
Message-ID: <3746@sirius.ucs.adelaide.edu.au>
Date: 20 Jun 91 08:25:24 GMT
Article-I.D.: sirius.3746
Sender: news@ucs.adelaide.edu.au
Reply-To: petera@chook.adelaide.edu.au (Peter Ashenden)
Organization: Dept. Computer Science, University of Adelaide
Lines: 49
Nntp-Posting-Host: eeyore.cs.adelaide.edu.au