Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

{CVS ci] assign and set

5 views
Skip to first unread message

Leopold Toetsch

unread,
Apr 20, 2004, 3:44:50 AM4/20/04
to perl6-i...@perl.org
I've now checked in some changes WRT these opcodes.

1) Strings - summary

set Sx, Sy # alias Sx to Sy
set Sx, "str" # set Sx to COW copy of "str"
set Px, Sy # CHANGED make Px refer to Sy
assign Px, Sy # set Px to COW copy of Sy

2) PMC summary

set Px, Py # alias Px to Py
assign Px, Py # set Px to value of Py := Px->vtable->assign_pmc
setref Px, Py # make Px refer to Py := Px->vtable->set_pmc

The latter is the opposite of deref, which now calls the get_pmc()
vtable. C<assign> for reference PMCs is now just passed on.

leo

Jens Rieks

unread,
Apr 20, 2004, 9:51:57 AM4/20/04
to Leopold Toetsch, perl6-i...@perl.org
On Tuesday 20 April 2004 09:44, Leopold Toetsch wrote:
>    set Sx, Sy        # alias Sx to Sy
>    set Sx, "str"     # set Sx to COW copy of "str"
>    set Px, Sy        # CHANGED make Px refer to Sy
>    assign Px, Sy     # set Px to COW copy of Sy
What does this do now?
set Px, "str"

jens

Leopold Toetsch

unread,
Apr 20, 2004, 10:51:33 AM4/20/04
to Jens Rieks, perl6-i...@perl.org
Jens Rieks <par...@jensbeimsurfen.de> wrote:
> What does this do now?
> set Px, "str"

Good question:

$ cat set.pasm
new P0, .PerlString
set P0, "str"
set S0, P0
chopn S0, 2
print "str"
print "\n"
end

$ parrot set.pasm
s

:)

We should separate the 2 cases (set_p_sc and set_p_s) like it's done for
strings.

> jens

leo

0 new messages