Me wrote:
> Well, I could argue that c) already exists
> in the form of passing parameters in parens.

This reminds me of the Law of Demeter.  It specifies what your methods
should and shouldn't be able to do if you want to build a bright, shiny
system that never has bugs, maintains itself, turns water into wine, etc.

The essence is about limiting what you can access (and therefore screw up)
from a particular scope.  It's like a mild form of the "no side effects" 
policy of certain functional programming languages.  I'm not sure how 
applicable it's going to be to Perl 6, but here's the view from 30,000 feet.


Object Form of Law of Demeter
-----------------------------

  "Do not talk to strangers". 

  Within a method, messages can only be sent to the following objects:

  1. A parameter of the method, including the enclosing object (this or self);

     1.1. For pragmatic reasons: a global object;

  2. An immediate part object (computed or stored):

     2.1 An object that a method called on the enclosing object returns, 
         including attributes of the enclosing object;
     2.2 An element of a collection which is an attribute of the enclosing 
         object; 

  3. An object created within the method.


Usenet Form of Law of Demeter
-----------------------------

  * You can play with yourself. 
  * You can play with your own toys (but you can't take them apart), 
  * You can play with toys that were given to you. 
  * You can play with toys you've made yourself.


Interested parties should Google[ law of demeter ] for the full story.

A

Reply via email to