Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: RFC: Is there more to alias? (perl6)

by tye (Sage)
on Aug 25, 2004 at 14:33 UTC ( [id://385688]=note: print w/replies, xml ) Need Help??


in reply to Re: RFC: Is there more to alias?
in thread RFC: Is there more to alias?

Heh, I wonder if I'm missing something, but it appears that Data::Alias's interface is better in several ways than Perl6's. How will Perl6 support the following tasks other than with these relatively ugly hacks:

$w = alias [$x, $y, $z]; # vs. $w[0] := $x; $w[1] := $y; $w[2] := $z; alias push @x, $y; # vs. push @x, 0; @x[-1] := $y; alias my( @x )= @y; # vs. @x= (); @x[$_] := @y[$_] for 0 .. @y.last; alias my( @x )= GetList(); # vs. is this possible with Perl6's syntax?

Perhaps Perl6 should have 'alias' built in along with the more succinct := operator?

- tye        

Replies are listed 'Best First'.
Re^3: RFC: Is there more to alias? (perl6)
by Aristotle (Chancellor) on Aug 25, 2004 at 15:34 UTC

    The following might work, and if so would cover several of the cases:

    push @x, my $x := $_ for @y;

    But that's still much clumsier than Data::Alias.

    I have a hunch though that in Perl6 we'll be using the splat to do this, something remotely looking like

    *@x := *@y;

    Don't ask me about the precise syntax though.

    Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://385688]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2024-04-18 07:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found