On Wed, 2002-07-24 at 18:15, Aaron Sherman wrote: > On Wed, 2002-07-24 at 12:34, Fisher Mark wrote: > > > But then sometimes you'd *want* hashing to be based on the > > > content. > > > > OK, I'll bite -- when would you want this behavior? This behavior means > > that once you change the contents, the hash value would become irretrievable > > unless you restored the contents of the key. (Is this useful in functional > > programming?) > > That's no more true than in this case: > > $x = "abc"; > %h = ($x => 1); > $x = "123"; > > %h{"abc"} is still 1, not undefined. So to, in this case: > > my @x is Hashed::ByValues = (1,2,3); > %h = (@x => 1); > @x[1] += 4; > > %h{[1,2,3]} should still be 1, not undefined. Is this ever useful? Of > course! You're just associating a unique collection to some value. There > are any number of places where you would want to do that.
Note: I don't want this behaviour in Perl itself. I want this behaviour at least on some special PMC for my own project, a specification language which has by definition (ISO) that behaviour. So, while I'm thinking of implement my own PMC's for that language, I need at least some API to use with that purpose. And by the way, is there any chance of specific languages PMC be included in parrot while it can't load external PMC's? Thanks :) > > -- Alberto Manuel B. Simoes Departamento de Informática - Universidade do Minho http://alfarrabio.di.uminho.pt/~albie - http://numexp.sf.net