Even though it is slightly sloppy usage, I tend to use "points to" as equivalent to "is a reference to". Generally speaking, if you think of a reference as an arrow drawn on a diagram, a variable which holds a reference to another is at the tail and is called a reference to (or a pointer to), and the item that the reference "points at" is at the head and is called the referent. On occasion you'll hear a referent called a "target", but this is less common, and I haven't used that in my point-by-point response.

  1. $pest has the value 'flea'.
    1. alternatively contains, has, or even is - is is very sloppy semantics, but common when dealing with direct values
  2. $dog points to $pest, which points to 'flea'
    1. alternate: points to a reference to 'flea', or (more precisely) is a reference to a reference to 'flea', if we don't know or care about the name of the intermediate variable
  3. $bob is a reference to a reference to $pest.
    1. a pointer to a reference
    2. a pointer to a pointer
  4. $bob points to a reference to a reference to 'flea'
    1. or is a reference to a reference to a reference to'flea' (more strictly correct)
    2. refers to a reference to
  5. $pest is the referent of $dog
  6. 'flea' is the referent of the referent of $dog
  7. $dog is the referent of $bob
  8. $pest is the referent of the referent of $bob
  9. 'flea' is the value of the referent of $dog
  10. 'flea' is the value of the referent of the referent of $bob
  11. $dog and $cat are both references to $pest
    1. or "both point to $pest", with "both" implying identity of the two reference values
  12. $bob and $sue are both references to references to $pest
    1. or "indirect references to $pest".
    2. If they both pointed to the same reference to pest, I'd say either
      1. the phrase I just used in 12.1 - though that does not communicate that their referent is the same reference, and it implies "one or more" intervening references, not "only one"
      2. say they are references to a reference to $pest.
        1. Note the use of "a reference" to indicate that the referent is the same for both variables; implication is that the reference to $pest may or may not be exactly the same one, only that both of the references pointed to are references to $pest.
        2. Alternative they are "both pointers to the same reference to" $pest, making the fact that they both reference the same reference to $pest explicit, with the implication that this was a deliberate choice for them to have the same value.

It's remarkably difficult to be precise about this! I think I've covered the alternates you're likely to hear at this point, and it's taken quite a number of edits to be precise.


In reply to Re: What's Really in a Reference? by pemungkah
in thread What's Really in a Reference? by Xiong

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.