Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!garnet.berkeley.edu!ked From: ked@garnet.berkeley.edu (Earl H. Kinmonth) Newsgroups: comp.lang.c Subject: Re: %p and different pointer representations Message-ID: <21104@agate.BERKELEY.EDU> Date: 3 Mar 89 03:42:12 GMT References: <9382@bloom-beacon.MIT.EDU> <1089@vicorp.UUCP> <234@mstan.Morgan.COM> <16112@mimsy.UUCP> <9453@bloom-beacon.MIT.EDU> <1890@dataio.Data-IO.COM> <928@jhunix.HCF.JHU.EDU> <9765@smoke.BRL.MIL> Sender: usenet@agate.BERKELEY.EDU Organization: University of California, Berkeley Lines: 17 In article <9765@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: >In article <928@jhunix.HCF.JHU.EDU> ins_balb@jhunix.UUCP (Andy Matter) writes: >I don't understand why so many people seem to be concerned about >packing both object AND function pointers into the same type of >variable. (By the way, it CAN be done; use a union.) What sort >of program calls for such weirdness, anyway? The only genuine It doesn't take a particularly weird program to require this. Almost any program that interprets a script containing both function calls and variables (sym table references) will require this. The hoc calculator program in Kernighan/Pike, UNIX PROGRAMMING ENVIRONMENT, requires this. Any awk like program will require it. Any script for a spread sheet that uses functions and variable names will probably require it. So too will an editor that allows complex scripts. Generally such applications will generate a vector that contains a mix of calls to functions and objects (pointers to elements in a symbol table).