Simon Cozens:
# [EMAIL PROTECTED] (Damian Conway) writes:
# > There are in fact *two* types associated with any Perl variable:
# 
# Is there any chance we could make this a little more 
# confusing? One or two people still appear to be following you.

I'll make it a little simpler.  If A is the type of aggregate (Array,
Hash, RowOfKennels) and E is the type of element (Scalar, String, Dog),
here's where each goes:

        my E @var;                      #assumes Array
        my @var of E;           #same
        my E @var is A;         #No assumption
        my @var is A of E;      #same

'returns' is an exact synonym of 'of', so for the same of clarity and
brevity I'll ignore it.  (I would suggest, though, that anyone who uses
'returns' here in real code should be shot.)

Notice that E is always either at the front or behind an 'of', and A is
always after an 'is'.  (If you think of a variable as a stack of
properties, this 'is' is just specifying the root property.)

Is that clear enough, or should I say it a little slower?

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

"If you want to propagate an outrageously evil idea, your conclusion
must be brazenly clear, but your proof unintelligible."
    --Ayn Rand, explaining how today's philosophies came to be



Reply via email to