Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site ukma.UUCP Path: utzoo!watmath!clyde!cbosgd!ukma!david From: david@ukma.UUCP (David Herron, NPR Lover) Newsgroups: net.lang.c Subject: Another form of goto Message-ID: <721@ukma.UUCP> Date: Sun, 10-Feb-85 18:48:33 EST Article-I.D.: ukma.721 Posted: Sun Feb 10 18:48:33 1985 Date-Received: Mon, 11-Feb-85 06:35:19 EST Organization: Univ. of KY Mathematical Sciences Lines: 36 I came up with the following piece of C code the other night. A friend and I were talking about ways of writing a generic Forth interpretor in C. We realized that the register save/restore at procedure call cost a lot when you have lots of small routines (as in a forth interpretor). Also, a large switch statement has expenses of its own. Then we thought about indirect goto's. et voila: main() { int *a; b: a = b; printf("a = 0x%x\n", a); } (NOTE: This was compiled under 4.2BSD on a -750) This compiles and runs perfectly. However, when adding an obvious statement (namely, "goto *a") it won't let us compile it. It seems like the compiler will *almost* let us do this. What I want to know is, "can this be easily added to the language?", "Is it a reasonable thing to add?". Comments anyone? -- -:--:- David Herron; ARPA-> "ukma!david"@ANL-MCS or david%ukma.uucp@anl-mcs.arpa UUCP-> {ucbvax,unmvax,boulder,research}!anlams!ukma!david UUCP-> {mcvax!qtlon,vax135,mddc}!qusavx!ukma!david UUCP-> {A-Large-Portion-of-The-World}!cbosgd!ukma!david No stupid sayings (I can't think of one). No stupid disclaimers (Nobody else would claim my statements anyway).