Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy opcode inappropriate for copying a literal #83

Closed
p6rt opened this issue May 10, 2008 · 3 comments
Closed

copy opcode inappropriate for copying a literal #83

p6rt opened this issue May 10, 2008 · 3 comments
Labels

Comments

@p6rt
Copy link

p6rt commented May 10, 2008

Migrated from rt.perl.org#53956 (status was 'resolved')

Searchable as RT53956$

@p6rt
Copy link
Author

p6rt commented May 10, 2008

From @cognominal

The copy opcode is described as :

  =item B<copy>(inout PMC, invar PMC)

  Morphs the PMC in $1 to the type of the PMC in $2, then assigns $2 to $1.

But in most languages, the (deep?) copy of a literal is a rw entity

More so, in Perl6, the literal has type C<List> while the copy obtained by
C<my @​a = [1,2]> should have type C<Array>.

Additionnaly, in rakudo, the C<Array> behavior (including mutations)
is implemented as a a C<List>
as shown by C<my @​a; say @​a.WHAT>.

--
cognominal stef

@p6rt
Copy link
Author

p6rt commented May 23, 2008

From @pmichaud

Rakudo's use of the 'copy' opcode for assignment is a temporary thing,
until we have true container types (mutables) and can use the assign
opcode for assignment. At that point each of the container types will
have assign overloaded so that it can coerce the value into an
appropriate type as needed.

At any rate, I'm going to go ahead and close this ticket since it's not
really descriptive of how the overall problem will be solved (and we're
still working that out).

Pm

@p6rt
Copy link
Author

p6rt commented May 23, 2008

@pmichaud - Status changed from 'new' to 'resolved'

@p6rt p6rt closed this as completed May 23, 2008
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant