develooper Front page | perl.perl5.porters | Postings from June 2013

Re: key/value hash and index/valuse array slices syntax

Thread Previous | Thread Next
From:
Leon Timmermans
Date:
June 11, 2013 10:53
Subject:
Re: key/value hash and index/valuse array slices syntax
Message ID:
CAHhgV8hdgYJW2LP9NLBFh6_MzWP_=BoR049rw7bbbaJJujivew@mail.gmail.com
On Mon, Jun 10, 2013 at 11:41 PM, Ricardo Signes
<perl.p5p@rjbs.manxome.org> wrote:
> I am interested in the answers to Yves' questions, and I think that these
> slices look worth pursuing further.  I think there are going to be a lot of
> questions about how they should work at the edges to figure out, but given the
> broad strokes, this is a feature that I would totally use and that seems quite
> sensible.

I find myself missing this feature with some regularity, I would
really like to have this.

One question I do have: what should it do with nonexistent keys? E.g.

my %first = (a => 1, b => 2);
my %second = %first{qw/a c/};

Should %second now contain «c => undef», not no c at all? I think I'm
currently leaning towards the latter, it seems like the more useful
behavior to me.

Leon

Thread Previous | 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