home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 5053 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.2 KB

  1. Path: columba.udac.uu.se!sabik!m93kma
  2. From: m93kma@sabik.tdb.uu.se (Kristofer Maad)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Namespaces What are they?
  5. Date: 7 Mar 1996 10:04:46 GMT
  6. Organization: Uppsala University
  7. Message-ID: <4hmcbu$1fia@columba.udac.uu.se>
  8. References: <313523d8@aobh.xs4all.nl>
  9. NNTP-Posting-Host: sabik.tdb.uu.se
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Patrick van Beem (patrick@aobh.xs4all.nl) wrote:
  13.  
  14. : In a msg of 12 Feb 96 Timothy Eves wrote to All:
  15.  
  16. :  TE> Whilst looking through the Autodocs (OS v40) for the utility.library
  17. :  TE> I've come across several refernces to some software constructs called
  18. :  TE> Namespaces. What are they and what can the be used for?
  19.  
  20. : The namespace refers to the parts of a variable-name, used to make in
  21. : unique within a program. The intention is to keep names as short as
  22. : possible, without loosing the meaning. Things like routine-names etc. don't
  23. : belong to variables and are a waist of 'namespace' (this waist is called
  24. : 'namespace-polution'. For example
  25.  
  26. Well... I think that this is only half correct. According to what I've
  27. heard, a namespace is an environment in which you can "store" named
  28. objects. To define this mathematically, a namespace is a set of
  29. ordered pairs <n, o> where n is a name and o is an object.
  30.  
  31. In each namespace, all the objects must have unique names. But if you
  32. have two different namespaces, they can of course have two different
  33. (or equal) objects of the same name. The added information of which
  34. namespace is refferred is used to make the reference unambiguous.
  35.  
  36. For a concrete example, consider that you can have an AmigaDOS command
  37. called 'list' at the same time as there can be a running process in
  38. memory called 'list', or a variable in your sourcecode called
  39. 'list'. You can also have several files named 'list' in different
  40. directories - different directories are different namespaces.
  41.  
  42. /Kristofer
  43.  
  44. --
  45. Name:   Kristofer Maad           | "The satisfaction in making a 'crash-
  46. Snail:  Stureg. 12A, 3tr.        |  proof' system screw up completely
  47.         753 14 Uppsala           |  almost makes it worthwhile."  /Kris
  48. Phone:  018-51 11 44             |
  49. E-Mail: m93kma@student.tdb.uu.se |   <http://www.update.uu.se/~kris/>
  50.