Xref: utzoo comp.lang.pascal:2740 comp.lang.c:24017 Path: utzoo!utgpu!watmath!att!ima!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.pascal,comp.lang.c Subject: Re: There is a pas2c. Is there a c2pas? Message-ID: <15263@haddock.ima.isc.com> Date: 27 Nov 89 01:47:02 GMT References: <1486@ertw> <4289@helios.ee.lbl.gov> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Followup-To: comp.lang.misc Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 17 In article <4289@helios.ee.lbl.gov> antony@lbl-csam.arpa (Antony A. Courtney) writes: >I highly doubt there is or will ever be a C to Pascal converter. It's certainly possible, since the two languages are TM-equivalent. >Show me pointers to functions in Pascal ... One way to emulate this feature would be to keep track of the functions whose addresses are taken, and use an integer index instead: long (*pf)(); ==> var pf: 0..MAX_INDEX; pf = &f; ==> pf := INDEX_CORRESPONDING_TO_F; r = (*pf)(i); ==> if pf = 0 then r := f(i) else ... This isn't much worse than the cruft required to get sane string handling. Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint (Language-specific followups should go to c.l.c or c.l.pascal as appropriate. Default followups to c.l.misc.)