On Mon, 20 Jun 2005, BÁRTHÁZI András wrote:


I'm still interested in, why "alias" wouldn't be a native Perl 6 term?

I think, there are several reasons for "alias":

I am not arguing against alias, but just wanted to point out something.

- in Perl 6, currently there's no way to create a reference to a
  variable, _with the context of the variable_, too

unless you bind immediately where you declare the original variable:

Some new examples, maybe better than before:

sub kilobytes ($value:) is export {
        return $value*1024;
alias kilobytes, kilobyte;

replace the last line with:
  &kilobytes := &kilobyte;

and the scoping is not an issue.

And with synonyms, binding as soon as declaring seems prudent.


Abhijit Mahabal      http://www.cs.indiana.edu/~amahabal/

Reply via email to