Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site gitpyr.UUCP
Path: utzoo!watmath!clyde!bonnie!akgua!gatech!gitpyr!robert
From: robert@gitpyr.UUCP (Robert Viduya)
Newsgroups: net.lang.c,net.lang.pascal,net.lang,net.unix,net.sources
Subject: Re: C to Pascal translation.
Message-ID: <437@gitpyr.UUCP>
Date: Tue, 18-Dec-84 02:20:32 EST
Article-I.D.: gitpyr.437
Posted: Tue Dec 18 02:20:32 1984
Date-Received: Wed, 19-Dec-84 03:14:14 EST
References: <392@amdcad.UUCP> <1928@umcp-cs.UUCP>
Distribution: net
Organization: Georgia Tech, Atlanta
Lines: 33
Xref: watmath net.lang.c:3519 net.lang.pascal:161 net.lang:1142 net.unix:3127 net.sources:2206

> 
> 	union u {
> 		int (*f)();
> 		char *c;
> 	} u;
> 	h() {
> 		u.c = "foo";
> 	}
> 	g() {
> 		u.f = h;
> 	}
> 	main () {
> 		g();
> 		(*u.f)();
> 		printf("%s\n", u.c);
> 	}
> 
> If you make some restrictions, then it can sort of be done.

Actually, the restriction is not in the unions.  Pascal can handle the
concept of unions by using variant records with no tag field specifier.
The restriction of translating C to Pascal is that Pascal does not support
pointers to functions.

			robert
-- 
Robert Viduya
Office of Computing Services
Georgia Institute of Technology, Atlanta GA 30332
Phone:  (404) 894-4669

...!{akgua,allegra,amd,hplabs,ihnp4,masscomp,ut-ngp}!gatech!gitpyr!robert
...!{rlgvax,sb1,uf-cgrl,unmvax,ut-sally}!gatech!gitpyr!robert