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.
- $pest has the value 'flea'.
- alternatively contains, has, or even is - is is very sloppy semantics, but common when dealing with direct values
- $dog points to $pest, which points to 'flea'
- 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
- $bob is a reference to a reference to $pest.
- a pointer to a reference
- a pointer to a pointer
- $bob points to a reference to a reference to 'flea'
- or is a reference to a reference to a reference to'flea' (more strictly correct)
- refers to a reference to
- $pest is the referent of $dog
- 'flea' is the referent of the referent of $dog
- $dog is the referent of $bob
- $pest is the referent of the referent of $bob
- 'flea' is the value of the referent of $dog
- 'flea' is the value of the referent of the referent of $bob
- $dog and $cat are both references to $pest
- or "both point to $pest", with "both" implying identity of the two reference values
- $bob and $sue are both references to references to $pest
- or "indirect references to $pest".
- If they both pointed to the same reference to pest, I'd say either
- 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"
- say they are references to a reference to $pest.
- 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.
- 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.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.