On Wed, 20 Sep 2000, Nathan Wiger wrote:
> Camel-3 shows some interesting hints of what's been proposed for my
> declarations:
>
> my type $var :attribute = $value;
>
> And we all know that you can use my to declare a group of variables:
>
> my($x, $y, $z);
>
> Here's the issues:
>
> 1. How do the two jive together?
They don't.
> And, of course, the ultimate spaghetti:
>
> my (int ($x :unsign, $y) :big, char $z :long) :64bit;
>
> Meaning is left as an exercise for the reader. :-)
Show mercy Nate. What did the reader ever do to you?
I am hoping that I won't have to concern myself with signedness and size
of numerical values in perl6. It doesn't belong in a scripting language.
But there all sorts of modifications to my floating around that will
probably make the cut: the dubious laccess and raccess, public and
private, const, and shared.
Rather than loose the ability to say ($a, $b, $c) = (qw/a b c/) why not
just use some new keywords?
our ($count, $message) = (1, 'Mars needs coffee');
const (PI, HTTP_OK) = (3.14159, 200);
sub new {
my ($class) = @_;
my $self = bless ref $class || $class;
public (@$self{qw/ first_name last_name /}) = qw/Alan Gutierrez/;
private (@$self{qw/ weight salary /}) = qw/Err.. *Ahem*/;
laccess (@$self{qw/ age favorite_color /}) = qw/ 28 blue /;
raccess (@$self{qw/ gender eye_color /}) qw / male brown /;
}
As long as we don't have too many attributes (like int, 64bit, EBCDIC,
etc.) this is plausible.
Alan Gutierrez