|
hash multithreading and cross language issue: msg#00578lang.perl.perl6.internals
I note that the perlscalar code is careful about multithreading issues (example: "if we morph to a string, first clear str_val so that after changing the vtable a parallel reader doesn't get a gargabe pointer"), but reuses a static PMC* intret. The current PerlHash PMC coerces keys to strings, so the following will print bar: my %hash; $hash{1} = 'foo'; $hash{"1"} = 'bar'; print $hash{1}; Whereas the nearest equivalent in Python will print foo: dict = {} dict[1] = 'foo' dict["1"] = 'bar' print dict[1] For Python support, it would be ideal if there would be a hash method entry in the VTABLE for each object. - Sam Ruby |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Python/Pirate status: 00578, Sam Ruby |
|---|---|
| Next by Date: | Re: pmc_type: 00578, Stéphane Payrard |
| Previous by Thread: | Python/Pirate statusi: 00578, Sam Ruby |
| Next by Thread: | Re: hash multithreading and cross language issue: 00578, Leopold Toetsch |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |