🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #107

Re: A challenge to the anti-goto

#107
From: Herman Rubin
Date: Sat, 31 Oct 1992 13:55
46 lines
2585 bytes
In article <1css0nINNc51@agate.berkeley.edu> jhauser@pine.CS.Berkeley.EDU (John Hauser) writes:
>In article <BwxsF6.3DF@mentor.cc.purdue.edu> hrubin@pop.stat.purdue.edu (Herman Rubin) writes:

>|extern B;
>|n = 0; m = 0; b = B;
>|{goto start;
>| case 1:	n += 1;
>| case 3:
>| case 5:
>| case 6:
> [etc.]

>|Now I suspect that anyone not brainwashed, and knowing that braces are used to
>|delimit blocks, and what switch means, can see the layout.

>I'm trying.  But this has got to be about the chewiest goat ooze I've gnawed
>on in a while.  Anyone want to give me a hint about how to interpret that
>first string of disembodied `case's?

That one is easy.  If you like, put all of those which appear before the
start: statement after the switch statement and put a break at the end.

But in looking at the code, I saw no reason why the cases for a switch
should all have to appear after the switch statement.  I suggest that
languages and compilers develop the ability to move outside the switch
statement block; in that case, case 2 would be at label1 in the mask block,
case 4 at label2; and case 1 in the inner switch block at label5.  I did
not intend to confuse, but in looking at the details, this sprung up as a
run-time improvement.

>And if your compiler won't let you do basic formatting, Herman, I suggest
>you toss it and get another.  I'm sure there are some that will.

Where does a faculty member get such a compiler?  I have not run this through
a compiler; about all I can think of doing to get this coded intelligently is
to get a compiler not to do too much damage, and tweak the assembler output.

I doubt that there is an available compiler on the machines I have access to
which would be able to come up with the code which a human who understands
what is wanted can manage, especially as there is no way to indicate this
code in the languages.
-- 
Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907-1399
Phone: (317)494-6054
hrubin@snap.stat.purdue.edu (Internet, bitnet)  
{purdue,pur-ee}!snap.stat!hrubin(UUCP)
Technical Details
Message-ID: <Bwznzx.Dr1@mentor.cc.purdue.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!ames!purdue!mentor.cc.purdue.edu!hrubin
References: <1992Oct29.153514.22927@yrloc.ipsa.reuter.COM> <BwxsF6.3DF@mentor.cc.purdue.edu> <1css0nINNc51@agate.berkeley.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.arch,comp.lang.misc
Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!ames!purdue!mentor.cc.purdue.edu!hrubin
From: hrubin@mentor.cc.purdue.edu (Herman Rubin)
Subject: Re: A challenge to the anti-goto
Message-ID: <Bwznzx.Dr1@mentor.cc.purdue.edu>
Organization: Purdue University Statistics Department
References: <1992Oct29.153514.22927@yrloc.ipsa.reuter.COM> <BwxsF6.3DF@mentor.cc.purdue.edu> <1css0nINNc51@agate.berkeley.edu>
Date: Sat, 31 Oct 1992 13:55:08 GMT
Lines: 46