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
setref a misnomer?
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 Nov 2 2004, 1:21 pm
Newsgroups: perl.perl6.internals
From: ru...@intertwingly.net (Sam Ruby)
Date: Tue, 02 Nov 2004 13:21:37 -0500
Local: Tues, Nov 2 2004 1:21 pm
Subject: setref a misnomer?
I just spent some time debugging a problem which turned out to be due to
the "set" operator not doing what I expected (i.e., calling pmc_set).
In retrospect, what set id doing is perfectly defensible, but "setref",
as implemented by PerlScalar, remains counter intuitive, at least to me:

.sub main @MAIN
     $P0=new PerlInt
     $P0=1

     $P1=new PerlInt
     set $P1, $P0

     $P2=new PerlInt
     setref $P2, $P0

     $P0=2

     print "$P1 = "
     print $P1
     print "\n"

     print "$P2 = "
     print $P2
     print "\n"
.end

- 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 Nov 3 2004, 4:54 am
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Wed, 3 Nov 2004 10:54:40 +0100
Local: Wed, Nov 3 2004 4:54 am
Subject: Re: setref a misnomer?

Sam Ruby <ru...@intertwingly.net> wrote:
> I just spent some time debugging a problem which turned out to be due to
> the "set" operator not doing what I expected (i.e., calling pmc_set).
> In retrospect, what set id doing is perfectly defensible, but "setref",
> as implemented by PerlScalar, remains counter intuitive, at least to me:

Yep. The C<setref> opcode is intended to set a reference inside a
reference type, like Ref or SharedRef. The implementation of
perlscalar's setref is the old "assign the RHS value" behavior.

We have to cleanup classes.

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