Aaron Sherman:
# topicalize: To default to C<$_> in a prototype (thus 
# acquiring the caller's current topic).

Well, to topicalize a region of code is actually to specify a different
topic, that is, a different value for $_.  For example:

        $foo = new X;
        $bar = new Y;
        
        given $foo {
                print $_.type, "\n";    #prints "X"
                
                given $bar {
                        #XXX we're using 'given' for this too, right?
                        print $_.type, "\n";    #prints "Y"
                }
        }

(An aside: it strikes me that you could use C<given> as a scoped lexical
alias, i.e.

        my $foo="foo";
        my $bar="bar";

        print $foo;
        
        given $bar -> $foo {
                print $foo;
        }
        
        print $foo;

        #prints "foobarfoo"

Hmm...)

# signatureless sub: A sub that does not specify a prototype, 
# and thus has a default prototype of:
# 
#       sub($_//=$_){};
# 
# ne?

More like:

        a sub that was created with the arrow (->) or a bare block and 
        does not specify a prototype, and thus has a default prototype
        of:

                -> ($_ //= $OUTER::_) { };

Or some such.  (Maybe C<$_ //= $_> will work, but I have reservations
about that--especially about the possibility of that picking up $_
dynamically instead of lexically.  In some cases you want $_
dynamically, in others lexically.  Perhaps C<$_ is topic('lexical')> and
C<$_ is topic('dynamic')>?)

--Brent Dax <[EMAIL PROTECTED]>
@roles=map {"Parrot $_"} qw(embedding regexen Configure)

Wire telegraph is a kind of a very, very long cat. You pull his tail in
New York and his head is meowing in Los Angeles. And radio operates
exactly the same way. The only difference is that there is no cat.
    --Albert Einstein (explaining radio)


Reply via email to