Path: utzoo!mnetor!uunet!husc6!mailrus!ames!pasteur!ucbvax!hoptoad!gnu From: gnu@hoptoad.uucp (John Gilmore) Newsgroups: comp.lang.c Subject: Re: Macro parameters getting substituted into strings Message-ID: <4264@hoptoad.uucp> Date: 28 Mar 88 14:24:06 GMT References: <11879@brl-adm.ARPA> <4099@hoptoad.uucp> <7309@brl-smoke.ARPA> <8035@elsie.UUCP> Organization: Grasshopper Group in San Francisco Lines: 35 ado@elsie.UUCP (Arthur David Olson) wrote: > Here's an example (taken from "/usr/include/sys/ttychars.h") of how we coped > with the problem here at elsie... > > #if !defined __STDC__ && !defined __DECUS_CPP__ > #define CTRL(c) ('c'&037) > #else /* defined __STDC__ || defined __DECUS_CPP__ */ > #ifndef LETR_a > #define LETR_a 'a' > #define LETR_b 'b' > #define LETR_c 'c' >... #define LETR_y 'y' > #define LETR_z 'z' > #define LETR_A 'A' > #define LETR_B 'B' >... #define LETR_Z 'Z' > #endif /* !LETR_a */ > #define CTRL(c) ((LETR_ ## c) & 037) > #endif /* defined __STDC__ || defined __DECUS_CPP__ */ When I was 14 years old I wrote a program in an early BASIC (which did not support characters at all, just numbers), that would mess around with words (each character stored as a number) and print them out. The printout routine looked like: 4000 if (i = 1) print "A"; 4010 if (i = 2) print "B"; 4020 if (i = 3) print "C"; 4030 if (i = 4) print "D"; and so on... I was hoping to never have to do that sort of thing again. -- {pyramid,ptsfa,amdahl,sun,ihnp4}!hoptoad!gnu gnu@toad.com "Watch me change my world..." -- Liquid Theatre