Re: [perl #61770] Bare 'print' and 'say' calls should be compile errors

2009-01-11 Thread Patrick R. Michaud
On Sun, Jan 11, 2009 at 07:18:53PM -0800, Patrick R. Michaud via RT wrote: > On Wed Jan 07 17:54:26 2009, larry wrote: > Bare "say" and "print" are now illegal in Rakudo as of r35431. This > currently catches only the truly bare say/print -- the parenthesized > forms are still allowed: > > sa

[perl #61770] Bare 'print' and 'say' calls should be compile errors

2009-01-11 Thread Patrick R. Michaud via RT
On Wed Jan 07 17:54:26 2009, larry wrote: > [...] So my inclination is to outlaw > bare "say" as well, as an aid to catching a common p5thinko that > some folks might otherwise find difficult to debug. Bare "say" and "print" are now illegal in Rakudo as of r35431. This currently catches only the

Re: Solution to Games #2

2009-01-11 Thread Larry Wall
On Sun, Jan 11, 2009 at 04:24:08PM +0300, Richard Hainsworth wrote: > my ($name,@list) = .split /\,/; That shouldn't parse, because .split should not be looking for an argument list. (And, in fact, STD rejects it.) You need one of: my ($name,@list) = .split: /\,/; my ($name,@list) = .

Re: not wanting something

2009-01-11 Thread Larry Wall
On Tue, Jan 06, 2009 at 04:41:30PM +0300, Richard Hainsworth wrote: > Supposed I define > > regex digit { [0..9] } > > what is the negative? You need to be careful about what you mean here by "negative". If you mean "match a single character that is not in the list", then it is as Patrick said.

Re: [perl #62202] Problem with Configure.PL under Windows

2009-01-11 Thread Mark Glines
Alan Rocker (via RT) wrote: auto::gmp - Does your platform support GMP...Can't spawn ".\test_616.exe": Bad file descriptor at lib/Parrot/Configure/Utils.pm line 86. Thanks, this is a known issue with the libgmp.dll built with strawberry perl. (It was built with SSE2 instructions tha

Re: what is going on here?

2009-01-11 Thread Larry Wall
On Sat, Jan 10, 2009 at 11:26:50PM +0300, Richard Hainsworth wrote: > More precisely, I dont understand the meaning of the ':' after '.sort' It is turning the method call into a list operator, essentially. It's not the so-called indirect object syntax, or it would be written: my @ranking = so

Re: [perl #62206] Errors reported by mingw32-make test

2009-01-11 Thread Reini Urban
2009/1/11 via RT Alan Rocker : > # New Ticket Created by Alan Rocker > # Please include the string: [perl #62206] > # in the subject line of all future correspondence about this issue. > # http://rt.perl.org/rt3/Ticket/Display.html?id=62206 > > > Under Windows (XP Home) Strawberry Perl > Attached

Re: [perl #62204] Errors reported by mingw32-make

2009-01-11 Thread Reini Urban
2009/1/11 via RT Alan Rocker : > # New Ticket Created by Alan Rocker > # Please include the string: [perl #62204] > # in the subject line of all future correspondence about this issue. > # http://rt.perl.org/rt3/Ticket/Display.html?id=62204 > > > > (On Windows XP Home) after mingw32-make realclea

Re: Not a bug?

2009-01-11 Thread Larry Wall
On Sun, Jan 11, 2009 at 04:41:12PM -0800, Ovid wrote: : I really don't think this is a bug, but it did confuse the heck out of me at first. This *is* expected behavior due to how {} is interpolated in strings, yes? : : $ perl6 -e 'my $foo = "foo";say "<" ~ $foo ~ ">"' : : $ perl6 -e 'my

Re: [PATCH] Add .trim method

2009-01-11 Thread Ovid
- Original Message > This patch implements the .trim() method for strings. Now that I'm reading S29, I see there is no .trim() method there. I got that because it was referenced in pugs in the cookbook (not in tests, though) and I was trying to get the examples to run. Bummer :( C

Not a bug?

2009-01-11 Thread Ovid
I really don't think this is a bug, but it did confuse the heck out of me at first. This *is* expected behavior due to how {} is interpolated in strings, yes? $ perl6 -e 'my $foo = "foo";say "<" ~ $foo ~ ">"' $ perl6 -e 'my $foo = "foo";say "{" ~ $foo ~ "}"' ~ foo ~ Cheers, Ovid -

[PATCH]: implement .trim method

2009-01-11 Thread Ovid
This patch implements the .trim() method for strings. Two problems: 1. I don't like the double-negative, but I was unsure how to get rid of it. unless not_whitespace goto done 2. I don't like the magic number '32 not_whitespace = is_cclass 32, s, start $I0 = is_cclass .CCLASS_WHITESPA

[PATCH] Add .trim method

2009-01-11 Thread Ovid
This is an update to my last patch (which you may not see because I sent it from the wrong email address). Here are my updated notes: This patch implements the .trim() method for strings. Problem: I don't like the magic number '32 not_whitespace = is_cclass 32, s, start But I couldn't fig

Re: Allocation of PASM registers (in PASM mode)

2009-01-11 Thread Geoffrey Broadwell
On Sun, 2009-01-11 at 12:39 -0500, Andrew Whitworth wrote: > This is something that obviously needs to be avoided. PASM doesn't > require that P42 be the 42nd register in an array. It only requires > that values put into P42 aren't overwritten and the register isn't > repurposed later. The simplest

[perl #62204] Errors reported by mingw32-make

2009-01-11 Thread via RT
# New Ticket Created by Alan Rocker # Please include the string: [perl #62204] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=62204 > (On Windows XP Home) after mingw32-make realclean and Configure.pl STDERR output attache

[perl #62206] Errors reported by mingw32-make test

2009-01-11 Thread via RT
# New Ticket Created by Alan Rocker # Please include the string: [perl #62206] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=62206 > Under Windows (XP Home) Strawberry Perl Attached are STDERR output and the summary of S

[perl #62176] wierd seg.. Follow up

2009-01-11 Thread Richard Hainsworth
Following up. Note that you need to delete the first 'say' line and uncomment the second. Running the first 'say' line clears up the fault with the second one. Deleting the first, yields the fault. Tried the script using parrot and perl6.pbc eliminates the fault. Richard Patrick R. Michaud

[perl #62196] Null PMC access on smartmatch inside method in Rakudo

2009-01-11 Thread Carl Mäsak
# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #62196] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=62196 > rakudo: class A { method foo { say "" ~~ * } }; A.new.foo rakudo 35420: OUTPUT«Null PM

[perl #62200] [BUG] Role composition failure: erroneous method conflict

2009-01-11 Thread via RT
# New Ticket Created by Matthew Walton # Please include the string: [perl #62200] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=62200 > Put this code through Rakudo: use v6; role TestRole { method foo() { ... } }

[perl #62198] Rakudo: array and hash elements don't interpolate into strings

2009-01-11 Thread via RT
# New Ticket Created by Markus Laker # Please include the string: [perl #62198] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=62198 > Scalar variables interpolate, but array and hash elements don't: m...@edward:~$ perl6 -

[perl #62202] Problem with Configure.PL under Windows

2009-01-11 Thread via RT
# New Ticket Created by Alan Rocker # Please include the string: [perl #62202] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=62202 > Running Configure.pl under Windows (XP Home), Strawberry Perl, produces the following err

Re: what is going on here?

2009-01-11 Thread Moritz Lenz
Richard Hainsworth wrote: > Could someone help me understand what is going on in the following snippet? > > my %players = {'william'=>2, 'peter'=>3,'john'=>1,'mary'=>5}; > my @ranking = %players.sort: { .value }; > for @ranking {.say}; > > I cut and pasted from Patrick's blog on sorting and playe

[perl #62184] Rakudo doesn't DTRT with 'state' variables and cloned blocks

2009-01-11 Thread Carl Mäsak via RT
Carl (>): > Rakudo r35404 doesn't work according to spec in the area of 'state' > variables and cloned blocks. > > $ perl6 -e 'my $i = 0; my $func = { state $x = $i++; say $x }; my ($a, > $b) = $func.clone, $func.clone; $a(); $b(); $a()' > 0 > 1 > 2 > > According to S04, this should be equivalent

Re: [perl #61870] [BUG] [META] Trac system borks authenticated user's privileges

2009-01-11 Thread Bob Rogers
From: Allison Randal Date: Sun, 11 Jan 2009 01:13:06 -0800 Bob Rogers wrote: > > What about those of us who can't log in? I can't even reset my > password, let alone update anything . . . It won't let you log in at all? Or, once you log in it won't let you do anything?

[perl #62046] Error when defining a class method called 'list'

2009-01-11 Thread Patrick R. Michaud via RT
On Wed Jan 07 09:16:32 2009, cspencer wrote: > >class Foo { > method list { >say "bar" > } >}; > >my $f = Foo.new; >$f.list > > will produce the following error in Rakudo: > >too few arguments passed (0) - 1 params expected >current instr.: 'parrot;Foo;li

[perl #62030] perl -e does not populate @*ARGS

2009-01-11 Thread Patrick R. Michaud via RT
On Tue Jan 06 15:04:36 2009, mberends wrote: > Up until about mid December 2008, the Rakudo perl6 -e copied > its command line arguments into @*ARGS. Sorry, revision > number unknown. At the end of December, perl6 -e was > ignoring command line arguments. This feature is probably > untested. For ex

Re: Solution to Games #2

2009-01-11 Thread Carl Mäsak
Richard (>): > use v6; > > my %players; > my $scores = open('./skaters.txt', :r) or die $!; > for =$scores { > my ($name,@list) = .split /\,/; > %players{$name} = ([+] @list.sort[2..6]) / 5; > }; > > my @ranking = %players.sort: { .value }; > for -> $m { > given pop @ranking { > say "$m Me

[perl #62068] output from .perl for regex

2009-01-11 Thread Patrick R. Michaud via RT
On Sat Jan 10 10:00:20 2009, richardh wrote: > / + / is what I thought it should be. > > { ... } is what rakudo current gives, which from the point of view of > runnable code and comprehensible output, are wrong. In general, being able to use .perl on subs and methods implies that an implementat

[perl #62188] BEGIN blocks don't parse as expressions in Rakudo

2009-01-11 Thread Carl Mäsak
# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #62188] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=62188 > Rakudo r35404: $ ./perl6 -e 'BEGIN { say "OH HAI" }' # works OH HAI $ ./perl6 -e 'BEGIN

[perl #62186] BEGIN blocks don't return the value of their last statement in Rakudo

2009-01-11 Thread Carl Mäsak
# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #62186] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=62186 > I'm toying around with precompilation in Rakudo r35404. I can print the value of a 'tim

[perl #62184] Rakudo doesn't DTRT with 'state' variables and cloned blocks

2009-01-11 Thread Carl Mäsak
# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #62184] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=62184 > Rakudo r35404 doesn't work according to spec in the area of 'state' variables and cloned

Re: [perl #62176] wierd segmentation fault with correct code.

2009-01-11 Thread Richard Hainsworth
Thanks for the response. I downloaded parrot onto my office machine (35397), and tested as you suggested. All worked and in fact I couldnt reproduce the bug!!! :(( I will try again with parrot at home with version 35286 This happened to me before - I got a segmentation fault working with a H

[perl #62182] Match object .WHAT and numification yield Null PMC Accesses in Rakudo

2009-01-11 Thread Carl Mäsak
# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #62182] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=62182 > Rakudo r35404 doesn't know how to .WHATify or numify a Match object: $ perl6 -e "say ('

Re: [perl #62156] Problems with File objects

2009-01-11 Thread Jonathan Worthington
Patrick R. Michaud via RT wrote: On Sat Jan 10 03:34:57 2009, masak wrote: rakudo: File.new rakudo 35336: OUTPUT«get_bool() not implemented in class 'File' [...] rakudo: say File.new rakudo 35336: OUTPUT«get_string() not implemented in class 'File' [...] rakudo: say File.new.WHAT rakudo

Solution to Games #2

2009-01-11 Thread Richard Hainsworth
Here's a solution to Scripting Games #2. Script and data file attached. The algorithm closely follows the published solution by the perl expert. Here is the model solution use 5.010; use strict; use warnings; use List::Util qw(sum); my %score; open(my $fh, "<", "C:/Scripts/skaters.txt") or die

[perl #62148] Cannot take .values of an uninitialized Any variable

2009-01-11 Thread Carl Mäsak via RT
Pm (>), Carl (>>): > > Same goes for Undef, which should arguably also be able to output > > .values, I think. > > Perl 6 doesn't have C. What I guess I meant was that the following shouldn't happen either: $ perl6 -e 'my $x; say $x.values' Method '!flatten' not found for invocant of class 'Unde

[perl #62148] Cannot take .values of an uninitialized Any variable

2009-01-11 Thread Carl Mäsak via RT
Carl (>), Pm (>>), Carl (>>>): > > > Same goes for Undef, which should arguably also be able to output > > > .values, I think. > > > > Perl 6 doesn't have C. > > What I guess I meant was that the following shouldn't happen either: > > $ perl6 -e 'my $x; say $x.values' > Method '!flatten' not fou

Re: [perl #62176] wierd segmentation fault with correct code.

2009-01-11 Thread Richard Hainsworth
Have you got the second data file in the current directory? I link perl6 to /usr/local/bin, change to the directory with the text file (skaters.txt) and script (skatersv2.pl), and then run. Richard Will Coleda via RT wrote: On Sat Jan 10 12:19:38 2009, richardh wrote: Getting a wierd seg

Re: [perl #62164] Smartmatch dies when comparing a Str and an Array

2009-01-11 Thread Илья
Hi there, some additional information about that bug (I trying to found workaround): if ~~ /'a'/ { say "Yay" } # so Array ~~ Regex works properly ( Regex ~~ Array still broken) ":)".say if ~~ 'a' # nothing :( ":(".say if ~~ 'a b c' # :( # looks like arrays flattening (old bug again) here ihr

[perl #62178] [BUG] gather+while only takes last value tested

2009-01-11 Thread jason switzer
# New Ticket Created by "jason switzer" # Please include the string: [perl #62178] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=62178 > When mixing gather with a while loop, only the last element tested by the while predi

[perl #62176] wierd segmentation fault with correct code.

2009-01-11 Thread Will Coleda via RT
On Sat Jan 10 12:19:38 2009, richardh wrote: > Getting a wierd segmentation fault with the following program (also > attached). > > I am using rakudo from parrot 35286 > > When I run the program below, it runs and I get almost the right > answer > (but uninitialised values and > incorrect output)

[svn:parrot-pdd] r35410 - trunk/docs/pdds/draft

2009-01-11 Thread bernhard
Author: bernhard Date: Sun Jan 11 04:40:38 2009 New Revision: 35410 Modified: trunk/docs/pdds/draft/pdd08_keys.pod Log: [codingstd] shorten long lines. Modified: trunk/docs/pdds/draft/pdd08_keys.pod == --- trunk/docs

[perl #62156] Problems with File objects

2009-01-11 Thread Carl Mäsak via RT
Pm (>): > Is C a class? I can't find any mention of it in the synopses. OH, you're right. Changing the name of this ticket to "Rakudo shouldn't expose C as a core class". :)

Re: [perl #62164] Smartmatch dies when comparing a Str and an Array

2009-01-11 Thread Илья
Hi, ah, and this bug broke my code : I was using Str ~~ Array, Regex ~~ Array and it works properly before. > ":)".say if 'a' ~~ Non-dwimmy hyperoperator cannot be used on arrays of different sizes or dimensions. > ":)".say if /b/ ~~ Non-dwimmy hyperoperator cannot be used on arrays of different

Re: what is going on here?

2009-01-11 Thread Илья
Hi! > More precisely, I dont understand the meaning of the ':' after '.sort' see line 1825 of S03 C<< infix:<:>>>, the invocant maker ... ack (or grep) ': {}' in Spec dir can give a lot of examples. ihrd

Re: what is going on here?

2009-01-11 Thread Hal Wigoda
the first line creates a hash, the second line sorts the hash values into an array. the third loops thru the array values printing one array member per line On Jan 10, 2009, at 2:26 PM, Richard Hainsworth wrote: Could someone help me understand what is going on in the following snippet? my %p

[perl #62176] wierd segmentation fault with correct code.

2009-01-11 Thread via RT
# New Ticket Created by Richard Hainsworth # Please include the string: [perl #62176] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=62176 > Getting a wierd segmentation fault with the following program (also attached). I

[perl #62172] Rakudo forgets about the length of an array passed twice as a parameter

2009-01-11 Thread Carl Mäsak
# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #62172] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=62172 > perl6: my @a = 1..8; sub foo(@a) { say +...@a; bar(@a) }; sub bar(@a) { say +...@a }; f

[perl #62170] Rakudo retains the Perl 5 behavior of trimming trailing fields

2009-01-11 Thread Carl Mäsak via RT
On Sat Jan 10 09:45:05 2009, masak wrote: > rakudo: " a b c".split(/ <.sp>+ /).perl.say > rakudo 35344: OUTPUT«["", "a", "b", "c"]␤» > oh, and the p5 behavior of trimming trailing fields is not in p6 > (for split) > * masak submits rakudobug TimToady pointed out that Rakudo actually does as

Re: [perl #62170] Rakudo retains the Perl 5 behavior of trimming trailing fields

2009-01-11 Thread Carl Mäsak
Pm (>), Carl (>>): >> rakudo: " a b c".split(/ <.sp>+ /).perl.say >> rakudo 35344: OUTPUT«["", "a", "b", "c"]␤» >> oh, and the p5 behavior of trimming trailing fields is not in p6 >> (for split) >> * masak submits rakudobug > > This looks totally correct to me. What output are you expecting

Re: [Fwd: [Fwd: Re: what is going on here?]]

2009-01-11 Thread Brandon S. Allbery KF8NH
On 2009 Jan 11, at 3:50, Richard Hainsworth wrote: To be precise - why the ':' after the sort? '%players.sort' calls the 'sort' method/sub on the hash '%players'. '{.value}' runs '.value' on $_ at some point. But when? So once again, what is the ':' doing? How else could this code be writt

Re: [perl #61870] [BUG] [META] Trac system borks authenticated user's privileges

2009-01-11 Thread Allison Randal
Bob Rogers wrote: What about those of us who can't log in? I can't even reset my password, let alone update anything . . . It won't let you log in at all? Or, once you log in it won't let you do anything? I just reset your password, let me know if you don't get an automated email about th

[perl #61892] list-comprehension assignments with declaration

2009-01-11 Thread Patrick R. Michaud via RT
On Thu Jan 01 10:16:14 2009, dave.wh...@gmail.com wrote: > I've been trying to figure out how to do a "($hd, @tl) = @list" assignments. > > ./perl6 -e ' > my @list = 1,2,3; > my ($hd, @tl) = @list; > say ([$hd], [...@tl]).perl > ' > [[1], []] Now working as of 35397: $ cat x my @

[perl #61914] [BUG] Declarator Parser Failure if Whitespace after Opening Paren

2009-01-11 Thread Patrick R. Michaud via RT
On Fri Jan 02 12:06:57 2009, publiustemp-perl6compil...@yahoo.com wrote: > > However, any whitespace after the opening paren causes a parse > failure: > > class Foo { > has ($.this, > $.that, > ); > } > my Foo $foo .= new( this => 3, that => 4 ); > say $foo.this;

[perl #61916] initialization parameters from base classes

2009-01-11 Thread Patrick R. Michaud via RT
On Fri Jan 02 12:21:24 2009, dave.wh...@gmail.com wrote: > The default "new" method allows values of attributes to be set as > named args -- but rakudo doesn't hoist params from base classes: > > rakudo: class A { has $.foo }; class B is A { has $.bar > }; > B.new( foo => 1, bar =>

[Fwd: [Fwd: Re: what is going on here?]]

2009-01-11 Thread Richard Hainsworth
thanks for the response, but i was really looking for a bit more detail. To be precise - why the ':' after the sort? '%players.sort' calls the 'sort' method/sub on the hash '%players'. '{.value}' runs '.value' on $_ at some point. But when? So once again, what is the ':' doing? How else could

[perl #60734] [TODO] $^foo variable should also declare corresponding $foo variable

2009-01-11 Thread Patrick R. Michaud via RT
On Fri Nov 21 14:54:47 2008, masak wrote: > This should output "dito" twice: > > $ ./perl6 -e '{ say $^same; say $same }.("dito")' > Scope not found for PAST::Var '$same' > > ...but it doesn't in Rakudo r32290. but it does in r35397: $ ./parrot perl6.pbc > { say $^same; say $same }.('rakudo

[perl #60780] Trouble when iteration variables don't add up

2009-01-11 Thread Patrick R. Michaud via RT
On Mon Nov 24 09:12:36 2008, masak wrote: > rakudo: for 1..5 -> $a, $b { say $a, $b } > rakudo 33137: OUTPUT[12␤34␤StopIteration␤current instr.: > '_block11' pc 78 (EVAL_15:29)␤] > > I haven't searched the specs or the tests for what should happen, but > I'm pretty sure this shouldn't throw an e

[perl #61172] hash becomes string or int

2009-01-11 Thread Patrick R. Michaud via RT
Now fixed in r35397: $ ./parrot perl6.pbc > sub foo(%h?) { { a => 1, %h }.perl.say; }; > foo( { b => 2 } ); {"a" => 1, "b" => 2} > foo( { } ); {"a" => 1} > foo( ); {"a" => 1} > We need tests for optional array and hash parameters in the test suite, so assigning ticket to moritz.

[perl #60404] Array becomes string in subroutine or method calls

2009-01-11 Thread Patrick R. Michaud via RT
On Sat Nov 08 00:54:52 2008, ihrd wrote: > > sub foo (@a) { 1.say for @a } > foo((1,2,3,4)); # only one 1 > foo([1,2,3,4]); # only one 1 > foo( my @a = 1,2,3 ); # only one 1 Now fixed as of r35392: $ ./parrot perl6.pbc > sub foo(@a) { 1.say for @a } > foo((1,2,3,4)); 1 1 1