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

Re: Perlfunc for each(), keys(), values() has been changed

Thread Previous | Thread Next
Aristotle Pagaltzis
March 30, 2013 18:13
Re: Perlfunc for each(), keys(), values() has been changed
Message ID:
* demerphq <> [2013-03-30 17:50]:
> On 30 March 2013 08:05, Aristotle Pagaltzis <> wrote:
> > Now I know you are talking about the hash seed here,
> No, actually I am not. I am talking about the iterator randomizer
> combined with the hash seed.

I leave the specifics to the implementor. ;-) You know what I meant.

> > but that is my reading of it; there is no actual mention of that in
> > the text. In fact, as I already said in my above attempt at an
> > answer, it is hard to imagine whatsoever future implementation of
> > hashes to which this statement would not apply.
> It means exactly what it says, every individual hash has its own
> keyorder. This is not true in older perl's; two hashes with the same
> "insert history" would have the same structure and key order. In 5.18
> this wont be true.

And in a future Perl it *may* be still different, although, again, it’s
hard to imagine how.

> > The real reason I am uncomfortable with that statement is that its
> > focus is on how hashes work rather than on what semantics they are
> > *intended* to provide – put another way, it talks about “is” rather
> > than “ought”; and you cannot derive “ought” from “is” so I felt it
> > ought to talk about “ought” instead.
> The intention was to define things in such a way that it allows the
> widest range of implementations.

My point is it should not even try to allow different interpretations of
how it could be implemented; instead it should talk about the interface
contract *only*.

> If my wording needs help I'm open to further rewrites.

I stand by my initial proposal, I was just trying to clarify my thinking
about it (for myself as well).

Aristotle Pagaltzis // <>

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About