property hash changes r12043

2006-03-27 Thread Leopold Toetsch
Use Hash instead of PerlHash for properties * Parrot should only use core types * prophash now returns PMCNULL, if there aren't any properties this is necessary, because introspection (dump) would inject a property hash into all dumped PMCs * adjust dumper tests and Dumper.pir leo

Re: HASH changes

2003-11-10 Thread Leopold Toetsch
Jeff Clites wrote: Okay, that makes sense then. So is the current implementation incomplete? I ask because it looks like the mark functionality won't yet quite deal with non-PObj values, etc. The mark_key (and hash, compare) functions can be passed to the extended new_hash_x() creation functio

Re: HASH changes

2003-11-09 Thread Jeff Clites
On Nov 6, 2003, at 11:56 PM, Leopold Toetsch wrote: Jeff Clites <[EMAIL PROTECTED]> wrote: An alternative (which may or may not a good one) would be to say that you can never actually store a NULL in a hash Not good. The Hash (now) may take almost arbitrary key/value pairs. Value can be plain int

Re: HASH changes

2003-11-07 Thread Leopold Toetsch
Juergen Boemmels <[EMAIL PROTECTED]> wrote: > Attached patch implements this. Furthermore it implement hash_exists. > It does not break more tests than previously. > Is this ok to commit? Yes for me. While touching these files, you could rename HASH{,BUCKET} too to ucfirst lc $_. Thanks, leo

Re: HASH changes

2003-11-07 Thread Juergen Boemmels
Leopold Toetsch <[EMAIL PROTECTED]> writes: [...] > > void * hash_get(Interp * interpreter, HASH *hash, void *key); > > HASHBUCKET * hash_get_bucket(Interp * interpreter, HASH *hash, void *key); > > That's ok for me. For all of the "normal" Hash usage, we don't have NULL > values, so there is no

Re: HASH changes

2003-11-07 Thread Leopold Toetsch
Jeff Clites <[EMAIL PROTECTED]> wrote: > An alternative (which may or may not a good one) would be to say that > you can never actually store a NULL in a hash Not good. The Hash (now) may take almost arbitrary key/value pairs. Value can be plain ints ... > JEff leo

Re: HASH changes

2003-11-07 Thread Leopold Toetsch
Juergen Boemmels <[EMAIL PROTECTED]> wrote: > Yes this is a problem. I did a little research how other libraries > solve this problem. Oh man, there are many of them. "little" :) BTW, inside parrot: $ find . -name '*.c' | xargs grep hash_get and you'll see another hash implementation. > void

Re: HASH changes

2003-11-06 Thread Jeff Clites
On Nov 6, 2003, at 10:05 AM, Juergen Boemmels wrote: But I still have one problem: hash_put and hash_get are not symmetric. hash_put puts a void *value, but hash_get returns a HASHBUCKET. This looks wrong to me. When returning the value directly, we couldn't have NULL value's - or better NULL valu

Re: HASH changes

2003-11-06 Thread Juergen Boemmels
Leopold Toetsch <[EMAIL PROTECTED]> writes: > Juergen Boemmels <[EMAIL PROTECTED]> wrote: > > Hi, > > > the latest changes of HASH in src/hash.c makes t/src/hash.t fail > > badly. > > Oops, sorry (but at least it isn't the only broken test currently :) I committed a partial fix. Now the tests a

HASH changes

2003-11-06 Thread Juergen Boemmels
Hi, the latest changes of HASH in src/hash.c makes t/src/hash.t fail badly. It did not even compile because of the prototype change in hash_new. Ok that was easy to fix and I have already a fix in my tree, which at least compiles cleanly. But I still have one problem: hash_put and hash_get are no

Re: HASH changes

2003-11-06 Thread Leopold Toetsch
Juergen Boemmels <[EMAIL PROTECTED]> wrote: > Hi, > the latest changes of HASH in src/hash.c makes t/src/hash.t fail > badly. Oops, sorry (but at least it isn't the only broken test currently :) > But I still have one problem: hash_put and hash_get are not > symmetric. hash_put puts a void *valu