home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / gnu / misc / discuss / 3595 < prev    next >
Encoding:
Text File  |  1992-11-17  |  2.2 KB  |  52 lines

  1. Path: sparky!uunet!mdcbbs!swordfish!alanb
  2. Newsgroups: gnu.misc.discuss
  3. Subject: Re: Fortran Is Not Dead, Unfortunately
  4. Message-ID: <ALANB.92Nov17115348@catalina.sdl.mdcbbs.com>
  5. From: alanb@sdl.mdcbbs.com (Alan Braggins)
  6. Date: 17 Nov 92 10:53:47 GMT
  7. References: <FRIEDMAN.92Oct16200656@nutrimat.gnu.ai.mit.edu><STDKAP1.92Oct17132457@oedipus
  8.  .spc.uchicago.edu><FRIEDMAN.92Oct18171824@nutrimat.gnu.ai.mit.edu><BwCBBn.8Dq@
  9.  mtholyoke.edu> <HARDS4.92Oct19105906@evans.ee.adfa.oz.au><1992Oct19.212947.20744@maths.tcd.ie>
  10. Organization: Shape Data (Division of EDS), Cambridge UK
  11. Nntp-Posting-Host: 134.244.153.110
  12. In-reply-to: tim@maths.tcd.ie's message of Mon, 19 Oct 1992 21:29:47 GMT
  13. Lines: 37
  14.  
  15. >>>>> On Mon, 19 Oct 1992 21:29:47 GMT, tim@maths.tcd.ie (Timothy Murphy) said:
  16.  
  17. > hards4@evans.ee.adfa.oz.au (Brad Hards) writes:
  18.  
  19. >>   P.S.: At MHC they're teaching intro-CompSci and data structures in
  20. >>   ANSI C now... but I just recently discovered that at least one
  21. >>   instructor is busily trying to turn C into Pascal, by doing such
  22. >>   horrible things as using "const" to declare constants instead of using
  23. >>   the pre-processor.  Ugh!
  24.  
  25. > Are you sure this was in imitation of Pascal?
  26. > There are obvious advantages in using const --
  27. > for one thing, the compiler can check the type.
  28.  
  29. And you can have structure constants, and they show up in the debugger,
  30. and you can pass the integral ones to Fortran by address (see topic title).
  31.  
  32. But they aren't compile time constants, so can't be used for dimensioning
  33. arrays, or have constant folding done. Enums can, and can also be typechecked.
  34.  
  35. I'd like to see
  36.  
  37. extern const int foo = 5;
  38.  
  39. be legal, meaning "The space for foo is allocated elsewhere, but it is safe
  40. to assume it will be 5". Having a definition which is not initialised to
  41. the same value would be an error.
  42.  
  43. > Come on, admit it, the instructor was right ...
  44. Depends whether he taught which should be used where and why, or just presented
  45. a rule to be followed blindly...
  46.  
  47. --
  48.      Alan Braggins, alanb@sdl.mdcbbs.com, abraggins@cix.compulink.co.uk
  49. Shape Data - A division of EDS-Scicon Limited.   Cambridge, UK +44-223-316673
  50.    "Any technology distinguishable from magic is insufficiently advanced."
  51.  "My employer does not necessarily share my views - but I'm working on it."
  52.