My background is C, where the dot refers to an object attribute (or for non-OO folks, a structure element). Hmm. Let me explain better.
typedef struct foo { int iNumberOfHands; char *pszPlayerName; } PLAYER, *PTR_PLAYER; PLAYER astrScoundrels[]; PTR_PLAYER pstrThisPlayer;
This code defines a structure in C with two elements, and also defines types for an instance of the structure (PLAYER) and a pointer to a structure (PTR_PLAYER).

The type definitions are used to created an array of players and a pointer to a player. After all that, you use pstrThisPlayer->iNumberOfHands to get to a structure element using a pointer, and astrPlayer[2].iNumberOfHands to get to the same structure element using the structure itself.

Currently in Perl (there, you knew it was coming eventually), we use the arrow to refer to an object's attributes or members like

$Query = new CGI; $Value = $Query->param('foo'); # method call
In reality, $Query is an object and not a pointer to an object, so we should be using the dot syntax. Therefore, in Perl 6, we will be writing
$Query = new CGI; $Value = $Query.param('foo'); # method call
This is what C used all along, so going to the dot syntax is more othogonal. Or better. :)

--t. alex

"Nyahhh (munch, munch) What's up, Doc?" --Bugs Bunny

ps Good question.


In reply to Re: Noble DOT vs the Allmighty ARROW by talexb
in thread Noble DOT vs the Allmighty ARROW by BUU

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.