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

Scalar.perl produces confused results #5378

Open
p6rt opened this issue Jun 15, 2016 · 1 comment
Open

Scalar.perl produces confused results #5378

p6rt opened this issue Jun 15, 2016 · 1 comment
Labels

Comments

@p6rt
Copy link

p6rt commented Jun 15, 2016

Migrated from rt.perl.org#128406 (status was 'new')

Searchable as RT128406$

@p6rt
Copy link
Author

p6rt commented Jun 15, 2016

From zefram@fysh.org

Calling .perl on a Scalar container object produces output that represents
neither the container nor the contained value, but seems to arise from
a mixture of both​:

sub scalar-make(Mu $iv) { my $v = $iv; $v.VAR }
sub scalar-make (Mu $iv) { #`(Sub|92435288) ... }
my $x = scalar-make(22)
22
$x.WHAT.say
(Scalar)
$x.perl
Int.new
$x.perl.EVAL.WHAT.say
(Int)
$x.perl.EVAL
0

Scalar.perl ought to yield a constructor expression for a Scalar object,
including as a subexpression the .perl of the contained value. In the
above, $x.perl should be the moral equivalent of "scalar-make(22)", though
obviously it shouldn't refer to this user-defined function, and it should
include the other attributes of the Scalar such as its .name ('$v').

-zefram

@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