develooper Front page | perl.perl6.language | Postings from June 2005

Re: proposal: binding with a function

Thread Previous | Thread Next
June 20, 2005 10:57
Re: proposal: binding with a function
Message ID:

>>- in natural languages, synonims are very often - alias is a synonim
> Perl is modeled on natural languages, but that doesn't mean it is one.
>  At its core, Perl is a limited, artificial language being explicitly
> designed with certain goals.  One of those goals is that it should be
> as small as possible given the feature set we want it to support; an
> `alias` built-in that essentially duplicates an existing feature goes
> against that goal.

I can agree with it, but I think it would be a great feature. And it 
doesn't depends on Perl 6, but it depends on Parrot, as I think.

>>- 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)
> I'm not sure what you mean by "context" here.  Context has a very
> specific meaning in Perl, representing the type a function's caller is
> expecting; this doesn't seem to be what you're talking about here.
>>alias kilobytes, kilobyte;
> This is a couple punctuation symbols short of:
>     &kilobytes := &kilobyte;
> Or maybe:
>     &kilobytes ::= &kilobyte;
> I'm not really sure what behavior you have in mind for alias.

"&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. I 
would like to copy if the subroutine/variable is local, or exported, 
or... etc. Oh, I have the term: I would like to copy the _scope_ of it, 
too. Forget the "context". Simple binding shouldn't have to copy the 
scope, too.

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.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About