Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site hou5d.UUCP Path: utzoo!watmath!clyde!floyd!harpo!eagle!mhuxl!houxm!hogpc!houti!ariel!hou5f!hou5g!hou5h!hou5a!hou5d!mat From: mat@hou5d.UUCP Newsgroups: net.lang.c Subject: Unions w/o struct a crock? NO! Message-ID: <897@hou5d.UUCP> Date: Mon, 9-Apr-84 15:19:09 EST Article-I.D.: hou5d.897 Posted: Mon Apr 9 15:19:09 1984 Date-Received: Wed, 11-Apr-84 04:16:31 EST Organization: AT&T Information Systems Laboratories, Holmdel, NJ Lines: 19 Are unions outside of structs a crock? Well, there is one important situation where they are used. The system II and system V YACC parsers allow arbitrary objects to be passed on the value stack; consistancy is insured by declarations of types represented by terminals and by a rather weird syntax. This is only feasible with unions and the unions (unlike variant records) need no discriminant, so there is no surrounding struct. Why, oh why saddle a useful construct like the union with a problem-dependent restriction like discriminants? Why go out of your way to make something simple into something troublesome by adding combersome restrictions that are not universally necessary? -- from Mole End Mark Terribile (scrape..dig) hou5d!mat ,.. .,, ,,, ..,***_*.