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

  1. Path: sparky!uunet!pipex!warwick!uknet!root44!hrc63!mrcu!paj
  2. From: paj@uk.co.gec-mrc (Paul Johnson)
  3. Newsgroups: comp.lang.eiffel
  4. Subject: Re: Eiffel internals
  5. Message-ID: <2231@snap>
  6. Date: 19 Nov 92 09:51:11 GMT
  7. References: <Nov.17.18.57.56.1992.26484@paul.rutgers.edu> <1992Nov18.140905.23486@jyu.fi>
  8. Reply-To: paj@uk.co.gec-mrc (Paul Johnson)
  9. Organization: GEC-Marconi Research Centre, Great Baddow, UK
  10. Lines: 32
  11.  
  12. In article <1992Nov18.140905.23486@jyu.fi> sakkinen@jyu.fi (Markku Sakkinen) writes:
  13.  
  14. >In article <Nov.17.18.57.56.1992.26484@paul.rutgers.edu> partha@paul.rutgers.edu (nowhere_man) writes:
  15.  
  16. >>I might need this for my work.Suppose class C declares x of class type
  17. >>D, creates it and invokes x.m, where m is a method properly defined in
  18. >>class D. Now is there any way to find out at the callee (ie in class
  19. >>D) the (pointer to the) object of type C that calls the method m?
  20. >> ...
  21.  
  22. Whenever I need to do something like this, I make the client an
  23. argument to `m', so the call looks something like
  24.  
  25.     x.m (Current, foo, bar);
  26.  
  27. As to how to do it without the extra argument, I think the only way
  28. would be to take a look at the machine stack.  This will involve some
  29. assembly code.  A change to either your Eiffel compiler, your C
  30. compiler or your hardware would break it.
  31.  
  32. >This is not such a bad idea in principle.
  33.  
  34. I rather disagree.  If you want an object to know something then you
  35. should tell it explicitly.
  36.  
  37.  
  38. Paul.
  39. -- 
  40. Paul Johnson (paj@gec-mrc.co.uk).        | Tel: +44 245 73331 ext 3245
  41. --------------------------------------------+----------------------------------
  42. These ideas and others like them can be had | GEC-Marconi Research is not
  43. for $0.02 each from any reputable idealist. | responsible for my opinions
  44.