home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / misc / 3702 < prev    next >
Encoding:
Internet Message Format  |  1992-11-15  |  1.8 KB

  1. Path: sparky!uunet!utcsri!neat.cs.toronto.edu!tlai
  2. Newsgroups: comp.lang.misc
  3. From: tlai@cs.toronto.edu (Tony Wen Hsun Lai)
  4. Subject: Re: Accessing the hardware directly (Was: Pointers)
  5. Message-ID: <92Nov15.220846est.47880@neat.cs.toronto.edu>
  6. Organization: Department of Computer Science, University of Toronto
  7. References: <mwm.2n3n@contessa.palo-alto.ca.us> <BxrK6x.A04@mentor.cc.purdue.edu> <92Nov15.195430est.47880@neat.cs.toronto.edu> <BxsCMz.Mu1@mentor.cc.purdue.edu>
  8. Date: 16 Nov 92 03:09:02 GMT
  9. Lines: 20
  10.  
  11. In article <BxsCMz.Mu1@mentor.cc.purdue.edu> hrubin@mentor.cc.purdue.edu (Herman Rubin) writes:
  12. >What is my notation other than calling the function by an indirect reference,
  13. >and passing the argument similarly?  Now I can put the argument reference on
  14. >the stack by first reading it into a register and then putting that register
  15. >on the stack, but what is gained by that?  And if the machine does not have
  16. >a reasonable way to call a function by indirect reference, the only way that
  17. >it could be done is by placing the address in the code for the function call
  18. >at run time, and this, or any other, modification of code at run time is,
  19. >I believe, considered quite objectionable.
  20.  
  21. Just out of curiosity, what do you think a procedure type is?
  22.  
  23. In a language like Modula-3, conceptually, a procedure declaration is a
  24. declaration of a constant of the appropriate procedure type, and one can
  25. pass procedures as parameters, store procedures in variables, invoke
  26. procedures stored in variables, and the like.  A compiler will probably
  27. implement all this with pointers, but you don't have to explicitly
  28. dereference pointers yourself, just as you don't have to explicitly
  29. dereference pointers when passing arguments by reference in Pascal or
  30. FORTRAN.  Do you really like typing so many "&"'s and "*"'s in C?
  31.