home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / misc / 3628 < prev    next >
Encoding:
Text File  |  1992-11-13  |  1.8 KB  |  44 lines

  1. Newsgroups: comp.lang.misc
  2. Path: sparky!uunet!sun-barr!cs.utexas.edu!sdd.hp.com!decwrl!pa.dec.com!rdg.dec.com!jch
  3. From: jch@rdg.dec.com (John Haxby)
  4. Subject: Re: Pointers
  5. Message-ID: <1992Nov13.102813.9215@rdg.dec.com>
  6. Sender: news@rdg.dec.com (Mr News)
  7. Organization: Digital Equipment Corporation
  8. References: <1992Nov11.155149.14744@rdg.dec.com> <1992Nov12.081454.23507@jyu.fi> <1992Nov12.103513.14043@rdg.dec.com> <1992Nov12.141532.16375@jyu.fi>
  9. Date: Fri, 13 Nov 1992 10:28:13 GMT
  10. Lines: 32
  11.  
  12. In article <1992Nov12.141532.16375@jyu.fi>, sakkinen@jyu.fi (Markku Sakkinen) writes:
  13.  
  14. |> Don't be fooled by words.  Maybe the CLU literature does not much use
  15. |> the word 'reference' (I don't remember), but I cannot see any semantic
  16. |> difference between CLU variables (of non-atomic types) and reference
  17. |> (or pointer) variables in many other languages.  'By sharing' is
  18. |> exactly the same as 'by reference'.
  19.  
  20. In CLU, x in
  21.  
  22.     p1 = proc (x: int) ... end p1
  23. and
  24.     p2 = proc (x: string) ... end p2
  25.  
  26. is passed by sharing.  In the VAX implementation, the p1 has its
  27. argument passed by value, the second by reference (in the grubby
  28. depths).  In the PCLU implementation, both procedure calls pass
  29. a CLUREF structure (by value) which contains the value of an integer
  30. or a pointer to string data.  `By sharing' allows the implementation of
  31. the compiler to choose the mechanism for passing the parameter to
  32. a procedure, the only requirement is that changing the contents of a
  33. mutable argument is reflected in all instances of the argument.
  34.  
  35. Don't mix implementation strategies with language semantics.
  36.  
  37. -- 
  38. John Haxby, Definitively Wrong.
  39. Digital                <jch@rdg.dec.com>
  40. Reading, England        <...!uknet!wessex!jch>
  41.  
  42. ----------------------------------------------------------------
  43. The opinions expressed herein are my own, not my employers.
  44.