[perl #75710] [BUG] Whitespace trouble involving a sub whose name begins with 'x' in Rakudo

2010-06-14 Thread Carl Mäsak
# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #75710]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=75710 >


 okay, someone review what I'm doing and please tell me I'm
missing something obvious...   http://paste.lisp.org/+2DYG

pmich...@orange:~/rakudo$ cat x

our sub xyz($abc) { say $abc.WHAT; }

xyz(1);

pmich...@orange:~/rakudo$ ./perl6 x
===SORRY!===
Confused at line 2, near "our sub xy"
pmich...@orange:~/rakudo$

 oh, I found a bug for masak!
 pmichaud: that one should definitely not error out.
 if I change the name of the sub to something else it works.
 apparently it doesn't like 'xyz'
 is there a quote form beginning with x?
 rakudo: Quox
 rakudo ecacff: OUTPUT«===SORRY!===␤Confused at line 11, near "Quox"␤»
 same error
 rakudo: our sub xyz($abc) { say $abc.WHAT; }; xyz(1); say "alive"
 rakudo ecacff: OUTPUT«Int()␤alive␤»
 pmichaud: it only manifests in a file?
 it's also fine if there's a semicolon after the block
 oh.
 I'm guessing it's being confused by operator x
 rakudo: our sub xyz($abc) { say $abc.WHAT; }␤ xyz(1); say "alive"
 rakudo ecacff: OUTPUT«===SORRY!===␤Confused at line 11, near
"our sub xy"␤»
* masak submits rakudobug
 it's parsing as &infix:
 what does STD.pm have to say about it, I wonder?
 rakudo: ␤our sub xyz($x) { say $x }␤␤xyz 3
 rakudo ecacff: OUTPUT«===SORRY!===␤Confused at line 11, near
"our sub xy"␤»
 std: ␤our sub xyz($x) { say $x }␤␤xyz 3
 std 31238: OUTPUT«ok 00:01 109m␤»
 rakudo: ␤our sub xyz($x) { say $x }␤␤xyz 3
 rakudo ecacff: OUTPUT«===SORRY!===␤Confused at line 11, near
"our sub xy"␤»
 rakudo: ␤our sub xyz($x) { say $x }␤␤+ xyz 3
 rakudo ecacff: OUTPUT«3␤Method 'Num' not found for invocant
of class 'Perl6Sub' [...]
 pmichaud: what's that last evaluation?
 pmichaud: where does Perl6Sub enter into it?
 masak: the + is acting like an infix:<+>
 where it ought to be a prefix:<+>
 due to the same whitespace bug?
 yes
 I'm going to need to run STD on it to see how STD handles it
 so this all goes into the same ticket?
 it's the same problem, just demonstrating that the problem
is not strictly a ltm issue
 anyway, I want to make sure that STD doesn't see that 'x'
as &infix:
 (and then I'll figure out _how_ STD does it :)
 std: sub xyz ($abc) { say $abc.WHAT }␤x 3
 std 31238: OUTPUT«===SORRY!===␤Undeclared
routine:␤ 'x' used at line 2␤Check failed␤FAILED 00:01 106m␤»
 right
 so there's something missing in rakudo's close-brace
handling logic again
 anyway, I'll figure it out later.
 shouldn't it see it as statement-ending because the next
thing is a newline?
 sure, but the expression parser keeps going anyway
 actually, I misstated that
 the close brace is indeed marking end of statement
 but the expression parser is ignoring the end-of-statement condition
 the expression parser thinks "aha, whitespace and an infix,
I know what to do!"
 (because we're in the expression parser at the time this gets parsed)


[perl #75718] [BUG] Null PMC access when smartmatching on a subtype of Hash in Rakudo

2010-06-14 Thread Carl Mäsak
# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #75718]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=75718 >


 rakudo: subset A of Hash; sub foo(A $x) {}; foo {}
 rakudo bdbdfb: OUTPUT«Null PMC access in invoke()␤  in
'ACCEPTS' at line 1␤  in 'foo' at line 1:/tmp/e7jYXh7FK8␤  in 'foo' at
line 11:/tmp/e7jYXh7FK8␤  in main program body at line
11:/tmp/e7jYXh7FK8␤»
* masak submits rakudobug
 rakudo: sub foo($x where Hash) {}; foo {}; say "alive"
 rakudo bdbdfb: OUTPUT«alive␤»
 rakudo: subset A of Hash; say {} ~~ A
 rakudo bdbdfb: OUTPUT«Null PMC access in invoke() [...]
 ah. there it is.


[perl #75714] [BUG] trans() not working

2010-06-14 Thread via RT
# New Ticket Created by  Tadeusz Sośnierz 
# Please include the string:  [perl #75714]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=75714 >


Looks like "string".trans doesn't work as expected. I'm using the latest
rakudo relase (2010.05) with Parrot 2.4.0.

Output from perl6 REPL (few cases, just to make sure):

> say 'Hello World'.trans('aeo' => 'AEO');
too few positional arguments: 2 passed, 3 (or more) expected
# as suggested on #perl6 on freenode
> say (~'Hello World').trans('o' => '0')
too few positional arguments: 2 passed, 3 (or more) expected
> say 'Hello World'.trans([] => []);
too few positional arguments: 2 passed, 3 (or more) expected
> say 'Hello World'.trans(['a', 'e', 'o'] => ['A', 'E', 'O']);
too few positional arguments: 2 passed, 3 (or more) expected

Kind regards,
Ted


Re: [perl #75714] [BUG] trans() not working

2010-06-14 Thread Moritz Lenz
Tadeusz SoXXnierz (via RT) wrote:
> # New Ticket Created by  Tadeusz Sośnierz 
> # Please include the string:  [perl #75714]
> # in the subject line of all future correspondence about this issue. 
> # http://rt.perl.org/rt3/Ticket/Display.html?id=75714 >
> 
> 
> Looks like "string".trans doesn't work as expected. I'm using the latest
> rakudo relase (2010.05) with Parrot 2.4.0.

Rest assured that this is fixed in the current development version, and
thus in the upcoming release.

> Output from perl6 REPL (few cases, just to make sure):
> 
>> say 'Hello World'.trans('aeo' => 'AEO');
> too few positional arguments: 2 passed, 3 (or more) expected

HEllO WOrld

> # as suggested on #perl6 on freenode
>> say (~'Hello World').trans('o' => '0')
> too few positional arguments: 2 passed, 3 (or more) expected

Hell0 W0rld

>> say 'Hello World'.trans([] => []);
> too few positional arguments: 2 passed, 3 (or more) expected

HEllO WOrld

>> say 'Hello World'.trans(['a', 'e', 'o'] => ['A', 'E', 'O']);
> too few positional arguments: 2 passed, 3 (or more) expected

HEllO WOrld


All of these forms work in the development version.

Cheers,
Moritz



Re: "Using Perl 6": patch to build the book in either A4 or letter paper sizes

2010-06-14 Thread Moritz Lenz
Thanks Luc,

both of your patches are looking pretty nice, but I currently have
trouble managing them. Might I ask you to push them directly to a github
branch? Just tell me your github user ID, and I can give you commit access.

Also there's currently a tweak-latex branch on github, which you're very
welcome to comment on, and maybe join in there. I currently get two
streams of good contributions (from you, and Nikolai Prokoschenko on
that branch, whom I've put CC'), and I'm currently over-worked and
under-skilled to chose between them, or merge them.

So it would be really great if you could join forces.


One more thing: currently even in verbatim code, quotes are converted to
 "fancy" left/right code, which breaks copy&pasting code (and is simply
wrong even in the print version). Does anybody happen to know how to
suppress that, and emit simple ASCII quotes?

Cheers,
Moritz


Re: Severe performance loss, comparing with perl 5

2010-06-14 Thread Bruce Keeler

On 6/12/2010 11:03 PM, Xi Yang wrote:

I'm trying to use use Perl 6 to process some nucleotide sequences. However, I 
found it strangely slow on substr or string concat operations, compared with 
its Perl 5 equivalent.
   


Part of this is that perl6 reads files in utf8 by default, and 
operations like substr are just plain slow on utf8 strings.  I've been 
using something like this as a workaround:


use MONKEY_TYPING;
augment class IO {
multi method encoding($enc) {
$!PIO.encoding($enc);
}
}

my $io = open( ... );
$io.encoding('fixed_8');



Re: [perl #75668] [BUG] whitespace before ^ in rule

2010-06-14 Thread Bruce Keeler



I think whitespace before a leading/trailing ^/$ needs to be discounted.
Dwimmery and elegance demand.

   

+1


Re: [perl #75706] [PATCH] Pass False to MAIN for negated argument --/bool, not True does False

2010-06-14 Thread Ira Byerly
Moritz,

Thank you very much.

- Ira

On Sun, Jun 13, 2010 at 7:31 AM, Moritz Lenz via RT <
perl6-bugs-follo...@perl.org> wrote:

> Hi,
>
> thanks for your patch, I've applied it as
> bdbdfb2a27514595147664dbc8744882f51c609e and added some test to
> t/spec/S06-other/main-usage.t
>
> Cheers,
> Moritz
>


Re: "Using Perl 6": patch to build the book in either A4 or letter paper sizes

2010-06-14 Thread Luc St-Louis
On Mon, Jun 14, 2010 at 08:36:32PM +0200, Moritz Lenz wrote:
> Thanks Luc,
> 
> both of your patches are looking pretty nice, but I currently have
> trouble managing them. Might I ask you to push them directly to a github
> branch? Just tell me your github user ID, and I can give you commit access.

My gihub ID (and IRC nick) is 'lucs'.

> Also there's currently a tweak-latex branch on github, which you're very
> welcome to comment on, and maybe join in there. I currently get two
> streams of good contributions (from you, and Nikolai Prokoschenko on
> that branch, whom I've put CC'), and I'm currently over-worked and
> under-skilled to chose between them, or merge them.
> 
> So it would be really great if you could join forces.

Absolutely. Nikolai's tweak-latex work appears to advance things a lot.
I'd be happy to coordinate with him.

> One more thing: currently even in verbatim code, quotes are converted to
>  "fancy" left/right code, which breaks copy&pasting code (and is simply
> wrong even in the print version). Does anybody happen to know how to
> suppress that, and emit simple ASCII quotes?

No idea for now, but will be looking.

Thanks.



Re: "Using Perl 6": patch to build the book in either A4 or letter paper sizes

2010-06-14 Thread Bruce Gray


On Jun 14, 2010, at 1:36 PM, Moritz Lenz wrote:
--snip--


currently even in verbatim code, quotes are converted to
"fancy" left/right code, which breaks copy&pasting code (and is simply
wrong even in the print version). Does anybody happen to know how to
suppress that, and emit simple ASCII quotes?


I do not know the answer, but these links discuss the problem:
http://www.mofeel.net/809-comp-text-tex/23751.aspx
http://ansuz.sooke.bc.ca/software/latex-tricks.php
--
Hope this helps,
Bruce Gray (Util)