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

proposal: binding with a function

Thread Next
From:
=?iso-8859-2?Q?B=C1RTH=C1ZI_Andr=E1s?=
Date:
June 14, 2005 05:06
Subject:
proposal: binding with a function
Message ID:
Pine.LNX.4.61.0506141355510.16763@wish.hu
Hi,

As I know, for binding, you can use the := operator, and just this:

   $a := $b;

I would like to make a proposal, based on Ruby[1]:

   alias $a, $b;

It's a fun:

   sub newline {
 	"\n" x $_;
   }

   alias newlines, newline;

So you can write:

   print 5.enters;

Currently, you have to write it a more "uglier" way:

   my &newlines := &newline;

Anyway, char '&' is really neccesary there? It should work w/o it, too, as 
I think. Now - in Pugs - it doesn't.

Bye,
   Andras

[1] http://www.zenspider.com/Languages/Ruby/QuickRef.html#29

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About