Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!ucsd!ucbvax!agate!shelby!neon!Gang-of-Four!dkeisen From: dkeisen@Gang-of-Four.Stanford.EDU (Dave Eisen) Newsgroups: comp.lang.c Subject: Re: Follow up to How Do I Prototype this? Message-ID: <1990Jul4.020738.10317@Neon.Stanford.EDU> Date: 4 Jul 90 02:07:38 GMT References: <351@demott.COM> <300@taumet.com> Sender: news@Neon.Stanford.EDU (USENET News System) Organization: Sequoia Peripherals Lines: 30 In article <300@taumet.com> steve@taumet.UUCP (Stephen Clamage) writes: > >How does one write a function which might or might not have a first >argument of any type? However you do it, I suspect the program >would be very difficult to understand and maintain. Some re-thinking >of the program design would be in order. >-- The behavior of the function can be determined by the value of a global variable. The database package we use does something like this --- most of the database access functions take an optional database number which is needed only if you have opened more than one database and have not called d_setdb (int database_number) which tells the database library to use the given database_number for all future database access functions. The database library knows if this is the case by checking values in db_global, a global variable that stores all of the global database information. I don't agree with this design decision, but it isn't horrible either. -- Dave Eisen Home: (415) 323-9757 dkeisen@Gang-of-Four.Stanford.EDU Office: (415) 967-5644 1447 N. Shoreline Blvd. Mountain View, CA 94043