I noticed some changes in Pugs behaviour when trying to update the golf tests
(I will update them in svn within 24 hours, I hope). I'm not certain they are
bugs, hence this email.

This looks like a bug to me (it used to work):

# cat head5.p6
my @x = ( 'a1', 'a2', 'a3' );
say(@x[0..2]);

# pugs head5.p6
a3

The next one illustrates a difference in slice semantics between p5 and
pugs when slicing more elements than are in the array:

# cat lev6.p6
my @z = (
    'a1', 'a2', 'a3',
    'b1', 'b2', 'b3'
);
my @y = @z[0..6];
for (@y) { print "'$_'\n" }

# perl lev6.p6
'a1'
'a2'
'a3'
'b1'
'b2'
'b3'
''

Notice that p5 puts undef in the last element. Pugs does not do that.
Not sure if p6 is meant to be compatible with p5 in this case though.

BTW, Pugs currently does not accept the parens around (@y) above:

# pugs lev6.p6
''
No compatible subroutine found: &for
App "&for" [] [Var "@y"]

Removing the parens and it is happy:

# cat lev6a.p6
my @z = (
    'a1', 'a2', 'a3',
    'b1', 'b2', 'b3'
);
my @y = @z[0..6];
for @y { print "'$_'\n" }

# pugs lev6a.p6
'a1'
'a2'
'a3'
'b1'
'b2'
'b3'

This is also a recent change in behaviour; pugs used to be happy
with the parens around @y.

/-\


Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com

Reply via email to