Path: utzoo!attcan!uunet!van-bc!ubc-cs!alberta!dvinci!weyr!f72.n140.z1.FIDONET.ORG!Glenn.Caleval From: Glenn.Caleval@f72.n140.z1.FIDONET.ORG (Glenn Caleval) Newsgroups: comp.lang.c Subject: Re: #define end_{if|for|while|switch} } Was: Re: #define OR || Message-ID: <557.25DBEEC2@weyr.FIDONET.ORG> Date: 15 Feb 90 15:35:00 GMT Sender: ufgate@weyr.FIDONET.ORG (newsout1.26) Organization: FidoNet node 1:140/72 - The Flatlands, Regina Sask Lines: 44 > > IF () THEN > > ELSE > > ENDIF > What if the define's are as follows: > #define IF if Mommy, these men are scaring me! As someone who is just starting out to learn C, and I mean JUST, I have been reading this news for several weeks. Now I'm convinced that either I'm not convoluted enough to work in C or else you guys are scaring me on purpose. Scott McHaffie came close to what I have assumed was the sensible approach to this issue with the suggestion: > #define THEN /* start of an if statement */ > #define ENDIF /* end of an if statement */ But why must it be even convoluted to the point that you have extraneous "commands" floating around the source code. If you are concerned about saving keystrokes, why not use the keystroke macro editors built into most text editors? In trying to learn the language I have found it useful to extensively comment my infant efforts. To facilitate this I have defined keystroke macros such as ALT-I which produces: /*open if statement, level */ , and then manually enter what level the if statement is. No unknown statements show up in my code, but using these macros, almost every line is commented and for my own safety I type in manually the levels to keep track of nesting. Question: Doesn't this accomplish the same thing or am I really missing something here from my admitted ignorance of the language? -- Glenn Caleval - via FidoNet node 1:140/22 UUCP: alberta!dvinci!weyr!72!Glenn.Caleval Internet: Glenn.Caleval@f72.n140.z1.FIDONET.ORG Standard Disclaimers Apply...