ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl6-language
perl6-language
Re: proposal: binding with a function
by BÁRTHÁZI András other posts by this author
Jun 20 2005 8:05AM messages near this date
Re: proposal: binding with a function | Re: proposal: binding with a function
Hi,

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

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

- in natural languages, synonims are very often - alias is a synonim
- in Perl 6, currently there's no way to create a reference to a
   variable, _with the context of the variable_, too (binding just give
   me possibility to bind a variable into another, but the new variable
   won't be automatically have the same context, as the binded one)

Some new examples, maybe better than before:

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

So both routines will be an exported one. You can use this code then:

   say 1.kilobyte;
   say 2.kilobytes;

Bye,
   Andras

BÁRTHÁZI András wrote:
>  Larry,
>  
> > You can always write a macro that does that.
> > [...] That won't work on a method name anyway unless you do it in the
> > dispatch class.
> > [...]
> > You'll have to write your own macro if you want to do that.
>  
>  
>  As I understood, you wrote down, how I can workaround it with macros, 
>  and why it wouldn't work well. As I see, there's no a nice solution to 
>  alias a method or a sub, even with macros.
>  
>  But you didn't wrote, why are you against the 'alias'?
>  
>  Bye,
>    Andras
>  
Thread:
B=C1RTH=C1ZI_Andr=E1s
Larry Wall
Damian Conway
Ingo Blechschmidt
Juerd
Carl Franks
B=C1RTH=C1ZI_Andr=E1s
B=C1RTH=C1ZI_Andr=E1s
BÁRTHÁZI András
Brent 'Dax' Royal-Gordon
BÁRTHÁZI András
Brent 'Dax' Royal-Gordon
BÁRTHÁZI András
Abhijit Mahabal

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved