Will,

This appears to be the expected output.

Richard

On 01/11/2012 05:04 AM, Will Coleda via RT wrote:
On Mon May 10 07:31:39 2010, richardh wrote:
See IRC May 10
@.x[1 .. +@x] is not being treated (rakudo dies) in the same way as @y[1
.. +@y]

In particular:

finanalyst: rakudo: class AB{has @.x; method aa { my @y=1,2,3; .say for
@y[1 .. +@y]; .say for @.x; .say for @.x[1 ..^ +@.x] } };my AB $y
.=new(:x(1,2,3)); $y.aa;
p6eval: rakudo 3d3893: OUTPUT«2␤3␤␤1␤2␤3␤No applicable candidates found
to dispatch to for 'postcircumfix:<[ ]>'. Available candidates are:␤Mu :
Int $i;; *%_)␤Mu : Block $b;; *%_)␤Mu : !whatever_dispatch_helper ;;
*%_)␤␤current instr.: '!postcircumfix:<[ ]>' pc 11329
(src/builtins/Role.pir:26)␤»
This now says:

20:02<  [Coke]>  rakudo: class AB{has @.x; method aa { my @y=1,2,3; .say for
                 @y[1 .. +@y]; .say for @.x; .say for @.x[1 ..^ +@.x] } };my AB
                 $y.=new(:x(1,2,3)); $y.aa;
20:02<+p6eval>  rakudo 38165a: OUTPUT«2␤3␤Any()␤1␤2␤3␤2␤3␤»

Is this correct and closable?

More detail:

finanalyst: rakudo: my @x=1,2,3,4; .say for @x[1 ..^ +@x]
p6eval: rakudo 3d3893: OUTPUT«2␤3␤4␤»
finanalyst: works
finanalyst: rakudo: class AB{has @.x; method aa { .say for @.x; .say for
@.x[1 ..^ +@.x] } };my AB $y .=new(:x(1,2,3)); $y.aa;
p6eval: rakudo 3d3893: OUTPUT«1␤2␤3␤No applicable candidates found to
dispatch to for 'postcircumfix:<[ ]>'. Available candidates are:␤Mu :
Int $i;; *%_)␤Mu : Block $b;; *%_)␤Mu : !whatever_dispatch_helper ;;
*%_)␤␤current instr.: '!postcircumfix:<[ ]>' pc 11329
(src/builtins/Role.pir:26)␤»
finanalyst: doesnt work
masak: that is indeed odd.
colomon: ah, I believe that's an array-handling bug.
moritz_: seems like @.x is not the same kind of array as @x
moritz_: rakudo: class A { has @.x }; say A.new(:x[1, 2, 3]).x.WHAT
p6eval: rakudo 3d3893: OUTPUT«Array()␤»
colomon: ran into this same sort of problem passing @x as an argument.
moritz_: rakudo: class A { has @.x }; say A.new(:x[1, 2, 3]).x.PARROT
p6eval: rakudo 3d3893: OUTPUT«Array␤»
finanalyst: rakudo: class AB{has @.x; method aa { my @y=1,2,3; .say for
@y; .say for @.x; .say for @.x[1 ..^ +@.x] } };my AB $y
.=new(:x(1,2,3)); $y.aa;
p6eval: rakudo 3d3893: OUTPUT«1␤2␤3␤1␤2␤3␤No applicable candidates found
to dispatch to for 'postcircumfix:<[ ]>'. Available candidates are:␤Mu :
Int $i;; *%_)␤Mu : Block $b;; *%_)␤Mu : !whatever_dispatch_helper ;;
*%_)␤␤current instr.: '!postcircumfix:<[ ]>' pc 11329
(src/builtins/Role.pir:26)␤»
masak: rakudo: class A { has @.x }; say A.new(:x(1, 2, 3)).x.WHAT
p6eval: rakudo 3d3893: OUTPUT«Array()␤»
finanalyst: rakudo: class AB{has @.x; method aa { my @y=1,2,3; .say for
@y[1 .. +@y]; .say for @.x; .say for @.x[1 ..^ +@.x] } };my AB $y
.=new(:x(1,2,3)); $y.aa;
p6eval: rakudo 3d3893: OUTPUT«2␤3␤␤1␤2␤3␤No applicable candidates found
to dispatch to for 'postcircumfix:<[ ]>'. Available candidates are:␤Mu :
Int $i;; *%_)␤Mu : Block $b;; *%_)␤Mu : !whatever_dispatch_helper ;;
*%_)␤␤current instr.: '!postcircumfix:<[ ]>' pc 11329
(src/builtins/Role.pir:26)␤»
finanalyst: definitely treating @y and @.x differently
moritz_: rakudo: class AB{has @.x; method aa { my @y=1,2,3; .say for
@!x[1..^+@!x] } }; AB.new(:x[1, 2, 3]).aa
p6eval: rakudo 3d3893: OUTPUT«No applicable candidates found to dispatch
to for 'postcircumfix:<[ ]>'. Available candidates are:␤Mu : Int $i;;
*%_)␤Mu : Block $b;; *%_)␤Mu : !whatever_dispatch_helper ;;
*%_)␤␤current instr.: '!postcircumfix:<[ ]>' pc 11329
(src/builtins/Role.pir:26)␤»
- envi^home has joined the room
colomon: rakudo: sub foo(@a) { .say for @a[1 ..^ +@a] }; my @a = 1... 4;
foo(@a)
p6eval: rakudo 3d3893: OUTPUT«2␤3␤4␤»

- 18:25 -
colomon: hmmm....
finanalyst: shall i post a rakudobug?
* colomon still thinks it's related to a rakudobug from a couple of
weeks ago...
colomon: finanalyst: yes.



Reply via email to