Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!ccplumb From: ccplumb@watnot.UUCP Newsgroups: comp.lang.c Subject: Re: X3J11: Why no addresses of labels? (was: why no labelled loops?) Message-ID: <12537@watnot.UUCP> Date: Sun, 1-Mar-87 03:27:28 EST Article-I.D.: watnot.12537 Posted: Sun Mar 1 03:27:28 1987 Date-Received: Sun, 1-Mar-87 16:09:27 EST References: <1710@plus5.UUCP> <388@cognos.UUCP> <545@mntgfx.MENTOR.COM> Reply-To: ccplumb@watnot.UUCP (Colin Plumb) Distribution: world Organization: U. of Waterloo, Ontario Lines: 30 In article <545@mntgfx.MENTOR.COM> franka@mntgfx.UUCP (Frank A. Adrian) writes: > Now for my pet peeve. Why can't you take the address of a label? This > would be useful in writing threaded code interpreters and in doing high > performance code. As far as I know, there is no work around for this > problem. E.g., > > label *jump_table[] = { &exe_seg_0, &exe_seg_1, ... }; > > while (!halt_flag) { > /* do something to load the byte code */ > goto *jump_table[byte_code]; > > exe_seg_0: > /* stuff */ > continue; > > exe_seg_1: > /* stuff */ > continue; > } I could also use (read: would kill for) this feature. I've seen horrible kluges used by interpreter writers to get around this problem. Is there any good reason why this isn't implemented? -Colin Plumb (ccplumb@watnot.UUCP) Zippy says: I hope you millionaires are having fun! I just invested half your life savings in yeast!!