Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
hash multithreading and cross language issue
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sam Ruby  
View profile  
 More options Oct 27 2004, 6:58 pm
Newsgroups: perl.perl6.internals
From: ru...@intertwingly.net (Sam Ruby)
Date: Wed, 27 Oct 2004 18:58:43 -0400
Local: Wed, Oct 27 2004 6:58 pm
Subject: hash multithreading and cross language issue
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leopold Toetsch  
View profile  
 More options Oct 28 2004, 2:32 am
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Thu, 28 Oct 2004 08:32:41 +0200
Local: Thurs, Oct 28 2004 2:32 am
Subject: Re: hash multithreading and cross language issue

Sam Ruby <ru...@intertwingly.net> wrote:
> 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.

Lets postpone multi-threading issues for a while.

>    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.

Not only ideal but necessary. The stringification of hash keys is a
perlism that just isn't usable for Python.

> - Sam Ruby

leo

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »