Re: =>'s container and binding semantics

2005-11-07 Thread Larry Wall
On Mon, Nov 07, 2005 at 11:20:39PM +0200, Ilmari Vacklin wrote: : On Mon, Nov 07, 2005 at 12:05:30PM -0800, Larry Wall wrote: : > On Mon, Nov 07, 2005 at 11:53:26AM -0800, Larry Wall wrote: : > : Also, if we provide a way to return a pair instead of a value from a : > : hash (currently done with th

Re: =>'s container and binding semantics

2005-11-07 Thread Ilmari Vacklin
On Mon, Nov 07, 2005 at 12:05:30PM -0800, Larry Wall wrote: > On Mon, Nov 07, 2005 at 11:53:26AM -0800, Larry Wall wrote: > : Also, if we provide a way to return a pair instead of a value from a > : hash (currently done with the new :%hash syntax), > > Whoops, I forgot I changed that to %hash: (an

Re: =>'s container and binding semantics

2005-11-07 Thread Ingo Blechschmidt
Hi, Larry Wall wrote: > On Sun, Nov 06, 2005 at 03:10:40PM +0100, Ingo Blechschmidt wrote: [ => should not automatically bind its .value to the RHS ] > I think binding directly to .key or .value is different from what => > does. So after > > $pair = $key => $value; > > setting $value doesn

Re: =>'s container and binding semantics

2005-11-07 Thread Larry Wall
On Mon, Nov 07, 2005 at 11:53:26AM -0800, Larry Wall wrote: : Also, if we provide a way to return a pair instead of a value from a : hash (currently done with the new :%hash syntax), Whoops, I forgot I changed that to %hash: (and %hash:{'key'} too). Larry

Re: =>'s container and binding semantics

2005-11-07 Thread Larry Wall
On Sun, Nov 06, 2005 at 03:10:40PM +0100, Ingo Blechschmidt wrote: : Hi, : : my ($key, $value) = ; : my $pair = ($key => $value); : : $pair.key = "new"; : # Should this fail ("cannot modify a constant")? : # Should this update $pair.key, but leave $key untouched? :

=>'s container and binding semantics

2005-11-06 Thread Ingo Blechschmidt
Hi, my ($key, $value) = ; my $pair = ($key => $value); $pair.key = "new"; # Should this fail ("cannot modify a constant")? # Should this update $pair.key, but leave $key untouched? # Should this update $pair.key, implicitly updating $key as well? $pair.value