home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19617 < prev    next >
Encoding:
Text File  |  1993-01-12  |  1.3 KB  |  41 lines

  1. Path: sparky!uunet!dtix!darwin.sura.net!zaphod.mps.ohio-state.edu!cs.utexas.edu!asuvax!ncar!noao!amethyst!organpipe.uug.arizona.edu!news
  2. From: dave@cs.arizona.edu (Dave Schaumann)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: struct vs. typedef
  5. Message-ID: <1993Jan13.035920.13278@organpipe.uug.arizona.edu>
  6. Date: 13 Jan 93 03:59:20 GMT
  7. References: <uRL4wB7w165w@cybrspc.uucp> <1993Jan11.170937.22822@informix.com> <1993Jan13.020738.9171@massey.ac.nz>
  8. Sender: news@organpipe.uug.arizona.edu
  9. Reply-To: dave@cs.arizona.edu (Dave Schaumann)
  10. Organization: University of Arizona
  11. Lines: 27
  12. In-Reply-To: news@massey.ac.nz (USENET News System)
  13.  
  14. In article <1993Jan13.020738.9171@massey.ac.nz>, news@massey (USENET News System) writes:
  15. >I prefer,
  16. >
  17. >#define ITEM struct n
  18. >
  19. >typedef ITEM {
  20. [...]
  21. >};
  22.  
  23. Echh!  IMHO, this is bletcherous.  The biggest abuse of the preprocessor
  24. I can think of is to use it to hide keywords; to make the language look
  25. like something it's not.
  26.  
  27. Why not just do it like this:
  28.  
  29. typedef struct foo *foo_ptr ;
  30.  
  31. struct foo {
  32.   /* whatever */
  33.   foo_ptr succ, pred ;
  34.   } ;
  35.  
  36. -- 
  37. You unlock this door with the key of imagination.  Beyond it is another
  38. dimension: a dimension of sound, a dimension of sight, a dimension of mind.
  39. You're moving into a land of both shadow and substance, of things and ideas.
  40. You've just crossed over into... the Twilight Zone.
  41.