Or we could go with Valspeak:

    $a is like $b and stuff

At the moment I like "like" the best, actually...
Hmmm... I could actually see "like" in a more active role. Along the lines of:

my str $string;
my $other_string is like $string;

Analogous to saying:

my str $other_string

Except that it would get new type information if the type of $string is changed at some point. Might be useful for generic classes.

class LimitedStack {
attr @.array;
my $init;
method new($first, *@others are like $first) {
$init = $first;
@.array.push($first, *@others);
}
method push(*@items are like $init) { ... }
method pop { ... }
}

Also, this brings to mind the one thing I actually remember about Sather, and as long as we're discussing operators...

Will we have similar to Sather's "::="? That was essentially the "statically type this variable at run-time based on the type of it's initial value" operator.

Reply via email to