%p and different pointer representations

Earl H. Kinmonth ked at garnet.berkeley.edu
Fri Mar 3 13:42:12 AEST 1989


In article <9765 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
>In article <928 at jhunix.HCF.JHU.EDU> ins_balb at 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).



More information about the Comp.lang.c mailing list