Skip Menu |
Report information
Id: 128406
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: zefram [at]

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)

From: Zefram <zefram [...]>
Subject: [BUG] Scalar.perl produces confused results
Date: Wed, 15 Jun 2016 06:13:08 +0100
To: rakudobug [...]
Download (untitled) / with headers
text/plain 755b
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: Show quoted text
> sub scalar-make(Mu $iv) { my $v = $iv; $v.VAR }
sub scalar-make (Mu $iv) { #`(Sub|92435288) ... } Show quoted text
> my $x = scalar-make(22)
22 Show quoted text
> $x.WHAT.say
(Scalar) Show quoted text
> $x.perl Show quoted text
> $x.perl.EVAL.WHAT.say
(Int) Show quoted text
> $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

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at