Larry wrote:

You have to have a way of talking about your own attributes *as if*
they were not your own attributes, and $.foo is that way.

When thinking about this, it's also important to remember that, in Perl 6, not everything with a sigil is automatically writeable. For example:

        constant $answer = 42;
        $answer = 99;                      # Kaboom!
        
        sub foo( $bar ) {
            $bar = 42                      # Biff!!
        }

        $baz := 86;
        $baz++;                            # Zowie!!!


Likewise a $.foo attribute defaults to read-only,
whereas a $!foo attribute defaults to read-write.

Damian

Reply via email to