🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #4139

Re: union types

#4139
From: Markus Schaub
Date: Sun, 27 Mar 1988 20:13
19 lines
1076 bytes
>     struct obj_name {		|	objName=RECORD
>        int obj_type;		|	  objType: INTEGER;
>        union {		|	  objId: RECORD
>           int id;		|	    CASE (* objType *):INTEGER OF
>           char *path;		|	    | 0:  id: INTEGER;
>        } obj_id;		|	    | 1:  path: POINTER TO CHAR
>     };			|	    END
>				|	  END
>				|	END
>				| 
> -- Mark Cornwell		| -- Markus Schaub

If obj_id is not used, you can simplify the RECORD to a single case-record.

-- 
     //	Markus Schaub			| The Modula-2 People:
    //	M2Amiga Developer		| Interface Technologies Corp.
\\ //   uunet!nuchat!sugar!schaub	| 3336 Richmond Ave. Suite 323
 \X/    (713) 523-8422			| Houston, TX 77098
Technical Details
Message-ID: <1769@sugar.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!rutgers!rochester!cornell!batcomputer!itsgw!steinmetz!uunet!nuchat!sugar!schaub
References: <8803221947.AA00248@nrl-iws6.ARPA>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!rutgers!rochester!cornell!batcomputer!itsgw!steinmetz!uunet!nuchat!sugar!schaub
From: schaub@sugar.UUCP (Markus Schaub)
Newsgroups: comp.lang.modula2
Subject: Re: union types
Message-ID: <1769@sugar.UUCP>
Date: 27 Mar 88 20:13:40 GMT
References: <8803221947.AA00248@nrl-iws6.ARPA>
Organization: Sugar Land UNIX - Houston, TX
Lines: 19