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 11:27AM messages near this date
Re: proposal: binding with a function | Re: proposal: binding with a function
Hi,

> >"&kilobytes := &kilobyte;" will not work for you (try it), because you
> >have to declare the "variable" kilobytes - in the default strict mode.
> >But you can't say for ex. "my &kilobytes", if you want to export it.
>  
>  So you say `our &kilobytes ::= &kilobyte` (or `:=`, you still haven't
>  said if alias works at compile time or runtime) and call it a day.
>  
>  IIUC, traits like `is exported` are attached to the container, not the
>  name; since aliasing connects a name to a container, you should be
>  fine on that front.  (If it doesn't work, that's because `is exported`
>  does something funky that `alias` would have to treat as a special
>  case; certainly other traits like `is rw` would follow a
>  `:=`-binding.)
>  
> >Anyway, "alias" is a Ruby term, and if Parrot will be able to support
> >Ruby, then it will be able to support this function, too.
>  
>  As I've said before, Perl supports `alias`--it's just spelled `:=`.

If you're right, then I'm happy. I don't want "alias", I would like to 
get it's behaviour. In Ruby, I think it's a compile time feature, but 
don't know, I'm not programming in Ruby.

I'm not (yet) an expert in Perl 6, so sorry if I'm not right, but "is 
exported" is about the name, not the container, as I think. If you 
attach an "is exported" to a class method, you can reach it from 
everywhere, just using it's name. If you say _in your class_ that "our 
&mysub ::= &exportedsub", then you can reach the mysub sub just in the 
class, not from everywhere in your program (as a plain sub). I'm really 
not sure, if I'm right, so please tell me, that I lost, and I will be 
happy. :)

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