Re: Assignment of UnManagedStruct in Perl6

[email protected] ("Patrick R. Michaud")
Newsgroups perl.perl6.internals
Message-ID <[email protected]>
On Wed, Nov 19, 2008 at 04:57:34PM +0900, Simon Cozens wrote:
> [...]
> From this I can conclude that my PIR open() code correctly returns an
> UnManagedStruct PMC; however, when Perl 6's assignment operator assigns
> this to a variable, a new, empty UnManagedStruct PMC is created and no
> longer contains the right data.
> 
> I have no idea how to fix this, but it looks like the assignment
> operator is broken.

We haven't really dealt with assignment of non-Perl 6 types until now.
In this case it was treating the UnManagedStruct as a scalar value,
and thus it tried to copy the PMC instead of creating a reference to it.

In r32873 I've updated assignment semantics so that it now tries to
do the right thing when dealing with something coming from outside
Rakudo's type system.  In particular, assigning an UnManagedStruct
to a scalar value should now properly take a reference instead
of attempting to do the copy.  Let us know if it helps.

Pm
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.