Re: Pop a Hash?

2005-02-13 Thread David Storrs
On Fri, Feb 11, 2005 at 05:33:29PM -0800, Ashley Winters wrote: > On Thu, 10 Feb 2005 08:59:04 -0800, David Storrs <[EMAIL PROTECTED]> wrote: > > On Wed, Feb 09, 2005 at 05:13:56AM -0600, Rod Adams wrote: > > > > > > ($k, $v) <== pop %hash; > > > make sense to anyone except me? > > > > ... the onl

Re: Pop a Hash?

2005-02-11 Thread Ashley Winters
On Thu, 10 Feb 2005 08:59:04 -0800, David Storrs <[EMAIL PROTECTED]> wrote: > On Wed, Feb 09, 2005 at 05:13:56AM -0600, Rod Adams wrote: > > > > Does > > > > ($k, $v) <== pop %hash; > > or > > ($k, $v) <== %hash.pop; > > > > make sense to anyone except me? > > ... the only time it's useful is > if

Re: Pop a Hash?

2005-02-11 Thread David Storrs
On Wed, Feb 09, 2005 at 05:13:56AM -0600, Rod Adams wrote: > > Does > > ($k, $v) <== pop %hash; > or > ($k, $v) <== %hash.pop; > > make sense to anyone except me? It's clear to me. The only thing is that, right off the top of my head, I can't see where it would be used. Since the order in whi

Re: Pop a Hash?

2005-02-09 Thread Eirik Berg Hanssen
Matthew Walton <[EMAIL PROTECTED]> writes: > Rod Adams wrote: >> Does >> ($k, $v) <== pop %hash; >> or >> ($k, $v) <== %hash.pop; >> make sense to anyone except me? > > Makes sense to me. Although I would be more inclined to think of pop > as returning a pair - but does a pair in list context turn

Re: Pop a Hash?

2005-02-09 Thread Matthew Walton
Rod Adams wrote: Does ($k, $v) <== pop %hash; or ($k, $v) <== %hash.pop; make sense to anyone except me? Makes sense to me. Although I would be more inclined to think of pop as returning a pair - but does a pair in list context turn into a list of key, value? If so then the above makes lots of se

Pop a Hash?

2005-02-09 Thread Rod Adams
Does ($k, $v) <== pop %hash; or ($k, $v) <== %hash.pop; make sense to anyone except me? Since we now have an explicit concept of pairs, one could consider a hash to be nothing but an unordered (but well indexed) list of pairs. So, C<< pop %hash >> would be a lot like C<< each >>, except, of cours