Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site oakhill.UUCP
Path: utzoo!watmath!clyde!bonnie!akgua!mcnc!decvax!tektronix!hplabs!hao!seismo!ut-sally!oakhill!davet
From: davet@oakhill.UUCP (Dave Trissel)
Newsgroups: net.lang.c,net.lang.pascal,net.lang,net.unix
Subject: Re: C to Pascal translation.
Message-ID: <284@oakhill.UUCP>
Date: Sat, 22-Dec-84 13:51:06 EST
Article-I.D.: oakhill.284
Posted: Sat Dec 22 13:51:06 1984
Date-Received: Thu, 27-Dec-84 02:14:29 EST
References: <392@amdcad.UUCP> <1928@umcp-cs.UUCP> 
Reply-To: davet@oakhill.UUCP (Dave Trissel)
Distribution: net
Organization: Motorola Inc. Austin, Tx
Lines: 32

<.......>
In article <437@gitpyr.UUCP> robert@gitpyr.UUCP (Robert Viduya) writes:
>> 
>> 	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 Viduya

Modula-2 does.  Note that Modula-2 also handles string ala "C" with a zero
terminator byte.

Motorola Semiconductor                             Dave Trissel
Austin, Texas          {ihnp4,seismo,gatech,ctvax}!ut-sally!oakhill!davet