home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / amiga / programm / 17943 < prev    next >
Encoding:
Internet Message Format  |  1992-12-30  |  1.6 KB

  1. Path: sparky!uunet!cs.utexas.edu!usc!rpi!batcomputer!ghost.dsi.unimi.it!univ-lyon1.fr!taloa.unice.fr!beust
  2. From: beust@aurora.unice.fr (Cedric Beust)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: How should I learn C?
  5. Date: 30 Dec 1992 10:15:34 +0100
  6. Organization: University of Nice Sophia-Antipolis, France
  7. Lines: 25
  8. Distribution: world
  9. Message-ID: <1hrpbmINNim3@aurora.unice.fr>
  10. References: <rlcarr.09er@animato.network23.com> <C01D36.BDC@unx.sas.com>
  11. NNTP-Posting-Host: aurora.unice.fr
  12.  
  13.  
  14. In article <C01D36.BDC@unx.sas.com>, walker@twix.unx.sas.com (Doug Walker)
  15. writes:
  16.  
  17. >|> There's nothing in C that should make you use globals where you did not use
  18. >|> them in Pascal.  I don't understand this complaint.
  19. >
  20. >Probably the scoping problem - you can declare a "local" in a pascal
  21. >procedure, and then use it in subprocedures.  The answer is to use
  22. >statics instead of globals, or to place all such variables in a
  23. >structure and pass the structure to all subroutines.
  24.  
  25.     On a related topic, you (Rick) might want to take a look at p2c.
  26.     It's a Pascal to C converter that will produce C from Pascal code,
  27.     even if it is very Pascal-dependant. This way, you will see how p2c
  28.     handles Pascal-scoping in C. For those of you who have never seen
  29.     this, it is a very interesting experience! Especially if you are
  30.     interested in compilers science.
  31.  
  32.     Basically, the idea is the one described by Doug but it must
  33.     take many other things in account.
  34.  
  35. --
  36. Cedric BEUST, beust@sa.inria.fr, Bull Research Koala proj, KoalaBus & xforum
  37. Pho:(33) 93.65.78.07(.66 Fax), INRIA, B.P.93 - 06902 Sophia Antipolis, FRANCE.
  38.