$epsilon = 1.0e-6 feels too big for Rat()

2015-12-31 Thread Dan Kogai
Folks,

I am only beginning to unwrap the christmas present but I immediately fell in 
love with the perl6 arithmetic system.  Not is it rich but it is also fast.

% perl6
> 340282366920938463463374607431768211297.is-prime
True
> 340282366920938460843936948965011886881.is-prime
False

And type conversions between numbers are smooth and seamless.  I couldn’t help 
loving Rat … except for one thing.

% perl6
> pi
3.14159265358979
> pi.Rat
3.141593
> pi.Rat.nude
(355 113)

That’s so 5th century!

https://en.wikipedia.org/wiki/Zu_Chongzhi

And of course,

> pi.Rat == pi
False

https://perl6advent.wordpress.com/2009/12/14/day-14-going-to-the-rats/

However, we can be more precise by simply giving 0 to $epsilon.

> pi.Rat(0).nude
(245850922 78256779)
> pi.Rat(0) == pi
True
> e.Rat(0) == e
True
> log(2).Rat(0) == log(2)
True

This I feel more natural.

http://doc.perl6.org/routine/Rat#role_Real says the default $epsilon is 1e-6.


Why so large?

Why not zero?

Dan the Perl6 Newbie




signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [perl #127101] Promise.allof() with empty argument is never kept

2015-12-31 Thread Elizabeth Mattijsen
> On 31 Dec 2015, at 07:29, Sam S. (via RT)  
> wrote:
> 
> # New Ticket Created by  Sam S. 
> # Please include the string:  [perl #127101]
> # in the subject line of all future correspondence about this issue. 
> # https://rt.perl.org/Ticket/Display.html?id=127101 >
> 
> 
> This hangs indefinitely:
> 
>my @promises;
>await Promise.allof(@promises);
> 
> Expected behavior: The await() should return immediately.
> 
> That would not just be the logical thing to do, but also make it consistent 
> with synchronous junctions:
> 
>my @values;
>say all(@values).Bool;  # True

Thanks for reporting!

Fixed with 37e998d , tests added with f153dc5 , can be closed.



Liz

[perl #127097] Error message for calling $.attr in BUILD could be improved

2015-12-31 Thread Larry Wall via RT
Now says: Virtual method call $.foo may not be used on partially constructed 
object (maybe you mean $!foo for direct attribute access here?)

Fix in 5a69da88b9b16f916125add8f89aff68113a9877


Re: [perl #127091] Newline Before Commas Results in 'Bogus Statement' Error

2015-12-31 Thread Elizabeth Mattijsen

> On 30 Dec 2015, at 17:32, Zoffix Znet (via RT)  
> wrote:
> 
> # New Ticket Created by  Zoffix Znet 
> # Please include the string:  [perl #127091]
> # in the subject line of all future correspondence about this issue. 
> # https://rt.perl.org/Ticket/Display.html?id=127091 >
> 
> 
> In the output below, you can see that inserting a new line before the comma 
> results in an error. 
> 
> Mentioned it here too: http://irclog.perlgeek.de/perl6/2015-12-30#i_11804178
> 
>  m: my @c = ( [{foo => 'bar'},],);
>  rakudo-moar d08e04: ( no output )
>  m: my @c = ( [{foo => 'bar'}  ,],);
>  rakudo-moar d08e04: ( no output )
>  m: my @c = ( [{foo => 'bar'}␤,],);
>  rakudo-moar d08e04: OUTPUT«===SORRY!=== Error while compiling 
> /tmp/4i3gP6j3p1␤Bogus statement␤at /tmp/4i3gP6j3p1:2␤--> my @c = ( [{foo 
> => 'bar'}⏏␤expecting any of:␤prefix␤statement end␤   
>  term␤»
>  m: my @c = ( [{foo => 'bar'} ␤,],);
>  rakudo-moar d08e04: OUTPUT«===SORRY!=== Error while compiling 
> /tmp/ClpK2AcBTF␤Bogus statement␤at /tmp/ClpK2AcBTF:2␤--> my @c = ( [{foo 
> => 'bar'}⏏ ␤expecting any of:␤prefix␤statement end␤   
>  term␤»

I concur with timotimo, this is ENOTABUG, but a WAT!

A closing brace at the end of a line (with or without whitespace) is equivalent 
to a ; *ALWAYS*.  And thus the statement becomes bogus.


Can be closed afaiac .



Liz

Re: $epsilon = 1.0e-6 feels too big for Rat()

2015-12-31 Thread Darren Duncan
Considering that a non-fat Rat has a 64-bit denominator, I would expect 
conversions from Num to make use of that full precision by default, and not 
round off to 6 decimal places. -- Darren Duncan




[perl #127102] GC error with NativeCall: Internal error: invalid thread ID ######## in GC work pass

2015-12-31 Thread via RT
# New Ticket Created by  William Herrera 
# Please include the string:  [perl #127102]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=127102 >


This bug (a MoarVM bug or ?) occurs while using 32-bit perl6 (MoarVM, no JIT), 
perl6 version 2015.09 built on MoarVM version 2015.09.

It occurs while using NativeCall to call a proprietary 32-bit .dll in Windows 
10, which is being used for a specialized BIOS hardware interface, so the 
source will not work on a generic Windows setup.

This native call works under Julia with similar parameters. The code "works" 
without an error trap if the line for the native call, which is the line
AsWMI_DeviceControl($pos, $colr +& 0xff);

which does the NativeCall to 
sub AsWMI_DeviceControl(int32, int32) is native("ACPIWMI") { * }

 is commented out, so it is not in the other code.

In perl6, the code exits after about 50 calls with the error message:

 ==
Internal error: invalid thread ID 31457303 in GC work pass
 ==

The thread ID varies from run to run, but the error consistently occurs after 
about 15 seconds of calling about 4 times a second. Before the error, the call 
works properly, setting the hardware without problems.



Re: release?

2015-12-31 Thread webmind


On 29/12/15 17:13, andy_b...@wiwb.uscourts.gov wrote:
> On Tue, Dec 29, 2015 at 01:57:57AM -0800, Darren Duncan wrote:
>>> On that note, are there going to be Perl 6 versions 6.x.y where {x,y} are
>> > integers?  Will 6.0.0 be the first such one? -- Darren Duncan
> 
> On Tue, Dec 29, 2015 Patrick Michaud wrote:
>> "Perl 6" is a language, not an implementation of that language.  Think
> of "Perl 6" as being like "C", "C++", "Javascript", etc., where the
> language is separate from the (many) implementations of that language.
> 
> I'm just a very ordinary perl hacker here, but Alex's point I think
> should be addressed.  Most of us (i.e ordinary, un-language
> implementation geeks) are looking to download a Perl6 and if it's rakudo
> x.y.z, fine, but make that seem like something like perl.6.tar.gz. It
> would seem that gently introducing the complete separation w/ a little
> of Perl's famous (to me) "syntatic sugar" (meta-syntatic?) to help us
> getting started.  Maybe the lower case distinction, "perl6.x.y" vs "Perl
> 6.c", would soothe both sides of the discussion.

Yes, wouldn't it make sense to couple the rakudo release version to the
language it implements?

Thanks for all your replies.


-- 
GPG Key: https://u2m.nl/data/webmind.asc
GPG Fingerprint: 0506976E 234653B4 A628EC33 E23D16EE FCF154AE
XMPP webm...@puscii.nl:  D79970A8 7EC43E29 186D86BA 590F20F6 4C7930B8
XMPP webm...@laglab.org: 11E91112 091881F7 53EF6108 63C48543 C74D035C
u2m.nl (exp: 08/04/2016) SHA256:
C2:40:67:22:25:52:29:AF:DF:50:4E:2A:6B:32:6D:BC:5B:1E:CA:7D:52:3B:4C:4A:21:5D:C8:E5:AE:7D:1A:09
Puscii (exp: 04/03/2016) SHA256:
F9:C7:B1:B7:90:6B:17:BF:84:93:93:7C:0F:B4:FD:BE:E3:C0:71:9D:83:01:ED:3A:96:FE:FC:82:9D:30:51:C9



0xFCF154AE.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: [perl #127064] Variable interpolation in regex very slow

2015-12-31 Thread Jules Field



On 29/12/2015 23:05, Timo Paulssen via RT wrote:

On 12/29/2015 12:46 AM, Jules Field (via RT) wrote:

# New Ticket Created by  Jules Field
# Please include the string:  [perl #127064]
# in the subject line of all future correspondence about this issue.
# https://rt.perl.org/Ticket/Display.html?id=127064 >


Given
my @lines = "some-text.txt".IO.lines;
my $s = 'Jules';
(some-text.txt is about 43k lines)

Doing
my @matching = @lines.grep(/ $s /);
is about 50 times slower than
my @matching = @lines.grep(/ Jules /);

And if $s happened to contain anything other than literals, so I had to us
my @matching = @lines.grep(/ <$s> /);
then it's nearly 150 times slower.

my @matching = @lines.grep($s);
doesn't appear to work. It matches 0 lines but doesn't die.

The lack of Perl5's straightforward variable interpolation in regexs is 
crippling the speed.
Is there a faster alternative? (other than EVAL to build the regex)


For now, you can use @lines.grep(*.contains($s)), which will be
sufficiently fast.

Ideally, our regex optimizer would turn this simple regex into a code
that uses .index to find a literal string and construct a match object
for that. Or even - if you put a literal "so" in front - turn it into
.contains($literal) if it knows that the match object will only be
inspected for true/false.

Until then, we ought to be able to make interpolation a bit faster.
   - Timo

Many thanks for that. I hadn't thought to use Whatever.

I would ideally also be doing case-insensitive regexps, but they are 50 
times slower than case-sensitive ones, even in trivial cases.
Maybe a :adverb for rx// that says "give me static (i.e. Perl5-style) 
interpolation in this regex"?
I can see the advantage of passing the variables to the regex engine, as 
then they can change over time.


But that's not something I want to do very often, far more frequently I 
just need to construct the regex at run-time and have it go as fast as 
possible.


Just thoughts from a big Perl5 user (e.g. MailScanner is 50k lines of it!).

Jules

--
ju...@jules.uk
Twitter: @JulesFM

'If I were a Brazilian without land or money or the means to feed
 my children, I would be burning the rain forest too.' - Sting


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



[perl6/specs] 325f7b: fix syntax in the advent calendar entry

2015-12-31 Thread GitHub
  Branch: refs/heads/master
  Home:   https://github.com/perl6/specs
  Commit: 325f7b27620e46bef87553c11cf943be8e0c72e1
  
https://github.com/perl6/specs/commit/325f7b27620e46bef87553c11cf943be8e0c72e1
  Author: Lucien Grondin 
  Date:   2015-12-30 (Wed, 30 Dec 2015)

  Changed paths:
M S99-glossary.pod

  Log Message:
  ---
  fix syntax in the advent calendar entry




[perl #127088] [BUG] GTP::Simple with Supply

2015-12-31 Thread via RT
# New Ticket Created by  Fritz Zaucker 
# Please include the string:  [perl #127088]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=127088 >


The following example adapted from Jnthn's example

https://gist.github.com/zaucker/826f5d4d6e5dd8956c0b

fails with

   Invalid GC status observed; aborting

on

This is Rakudo version 2015.12 built on MoarVM version 2015.12
implementing Perl 6.c.

Cheers,
Fritz

-- 
Oetiker+Partner AG  tel: +41 62 775 9903 (direct)
Fritz Zaucker+41 62 775 9900 (switch board)
Aarweg 15+41 79 675 0630 (mobile)
CH-4600 Olten   fax: +41 62 775 9905
Schweiz web: www.oetiker.ch


[perl6/specs] 6c54ce: fix title of S08

2015-12-31 Thread GitHub
  Branch: refs/heads/master
  Home:   https://github.com/perl6/specs
  Commit: 6c54ce5133f9b3afe2755b489feda58debf9bd66
  
https://github.com/perl6/specs/commit/6c54ce5133f9b3afe2755b489feda58debf9bd66
  Author: John Gabriele 
  Date:   2015-12-30 (Wed, 30 Dec 2015)

  Changed paths:
M html/index.html

  Log Message:
  ---
  fix title of S08




[perl #127093] gist missing for non-native typed array that doesn't get initialized

2015-12-31 Thread via RT
# New Ticket Created by  Leandro Hermida 
# Please include the string:  [perl #127093]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=127093 >


> my @a[4]
[(Any) (Any) (Any) (Any)]
> my Int @a[4] = 0..3
[0 1 2 3]
> my Int @a[4]
Method 'gist' not found for invocant of class 'NQPMu'

I expected:
[(Int) (Int) (Int) (Int)]

By defining native typed arrays do have a gist:

> my int @a[4]
[0 0 0 0]


[perl #127075] Error referencing non-ascii tokens on grammar

2015-12-31 Thread via RT
# New Ticket Created by  Rúbio Terra 
# Please include the string:  [perl #127075]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=127075 >


I can declare non-ascii tokens without problems on a grammar but I get an 
encoding error if I refer to the token using the <> syntax. This happens on 
MoarVM, it works fine on JVM.

This runs OK:

  perl6 -c -e 'grammar { token TOP { + }; token número {<< \d+ >>} }'
  Syntax OK

Now, if I reference the new token (número) I get an error:

  perl6 -c -e 'grammar { token TOP { + }; token número {<< \d+ >>} }'
  ===SORRY!===
  Error encoding ASCII string: could not encode codepoint 250

The same code on JVM runs OK:

  perl6-j -c -e 'grammar { token TOP { + }; token número {<< \d+ >>} }'
  Syntax OK

I'm running Linux Fedora 22. Both Rakudo 2015.11 and 2015.12 exhibit the error.


[perl #127107] "duplicate definition of symbol grammar" using Grammar::Tracer in .pm6 file

2015-12-31 Thread via RT
# New Ticket Created by  Faye 
# Please include the string:  [perl #127107]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=127107 >


$ cat Foo.pm6
use Grammar::Tracer;
$ perl6 -I. -e 'use Foo'
===SORRY!===
P6M Merging GLOBAL symbols failed: duplicate definition of symbol grammar

It appears that, for whatever reason, using Grammar::Tracer from within a 
module file causes that strange low-level error. Note that attempting 'use 
Grammar::Tracer' in a non-module file or directly in one-liners doesn't seem to 
be an issue:

$ perl6 Foo.pm6
$ perl6 -e 'use Grammar::Tracer'
$


[perl #127010] [LTA] Date.new(Str) limited year range

2015-12-31 Thread Christian Bartolomaeus via RT
On Thu Dec 24 01:37:47 2015, elizabeth wrote:
> 
> Fixed with fb475d22ba6d5507dd4db , test added with
> 7e5f5db4e12a07701c4da .

Great! I'm closing the ticket as 'resolved'.



Jonathan's "Perl 6 Introductory course"

2015-12-31 Thread Tom Browder
Jonathan's intro course, in pdf, here:

  https://github.com/rakudo/star/raw/master/docs/2015-spw-perl6-course.pdf

is excellent, of course.  But I really like the presentation theme and
the slide formatting!

Does anyone know what slide-making process he uses?

So far the best I have found that meets my needs is using asciidoc
input with Asciidoctor's Deck.js backend. I think I can convert from
the generated html to pdf but can't say for sure yet, but it is the
good looks of his slides that I'm primarily interested in.

Thanks.

Best regards,

-Tom


Re: [perl #126688] bug detecting circular dependencies

2015-12-31 Thread mt1957

On 12/31/2015 06:58 AM, Dave Rolsky via RT wrote:

I can confirm that this is still happening as of today's rakudo. It seems like 
an important bug to fix, but maybe more importantly, how are we supposed to 
handle circular deps? Consider a pair of classes, Tree and Node, which both 
need to refer to each other.

Tree.pm6


unit class Tree;

use Node;

has Node $top;



Node.pm6


unit class Node;

use Tree;

has Tree $tree;


Given that I have to use a module in order to refer to its type, this seems 
like a problem that will occur _way_ more often in Perl 6 than in Perl 5.


Often you  can cope by not typing them in both modules . Then e.g. the 
node create method in the Tree module creates the Node object which 
receives the Tree object via the BUILD method. The Node module then does 
not have to import the tree module because all information is included 
in the Tree object just received. So the 'use Tree;' in Node.pm is not 
needed.






Re: release?

2015-12-31 Thread Parrot Raiser
That's how I have Perl 6 (and a number of other packages) set up; a
version-agnostic name in a $PATH place, symbolically linking to
package directory.

On 12/31/15, Philip Hazelden  wrote:
> Note that if we want scripts to be interpreter-agnostic, the perl6 binary
> needs to exist for #! purposes. So renaming it would be bad, but a simlink
> would work.
>
> On Thu, Dec 31, 2015 at 2:27 PM Brock Wilcox 
> wrote:
>
>> On Tue, Dec 29, 2015 at 11:39 AM, webmind  wrote:
>>
>>>
>>> Yes, wouldn't it make sense to couple the rakudo release version to the
>>> language it implements?
>>>
>>
>> Naw -- there'll be probably monthly rakudo releases but the Specification
>> releases should be much less frequent -- like maybe every few months (at
>> first) or yearly is my guess.
>>
>> This might be less confusing if:
>> * We referred more often to rakudo instead of perl6 when we mean the
>> implementation (you compile with gcc, not "c"; rakudo confusingly calls
>> it's interpreter "perl6")
>> * Get more implementations! If we had like 3-4 implementations to choose
>> from then it might be more obvious what was going on.
>>
>> Probably there would be a stronger argument for the "perl6" binary to be
>> either renamed to "rakudo" or to be a symlink to whatever your
>> current-perl6-implementation is were there an alternative implementation
>> ... but there isn't... so ... I guess someone should do that. :)
>>
>> ... though there actually ARE a few others, but none nearly as complete
>> as
>> Rakudo, afaik
>>
>> * https://github.com/sorear/niecza - CLR
>> * http://fglock.github.io/Perlito/ - Perlito6 written mostly in Perl6
>> (lots of other interesting Perlito stuff)
>> * http://perl6.org/compilers/features - comparison
>> * several abandoned ones (e.g. Pugs)
>>
>> --Brock
>>
>>
>


[perl #127087] [BUG] NCurses and Supply

2015-12-31 Thread via RT
# New Ticket Created by  Fritz Zaucker 
# Please include the string:  [perl #127087]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=127087 >


Updating a "timer" from a for loop works as expected:

   https://gist.github.com/zaucker/aa14025a16edcd671e25

Updating it from an interval supply screws up the next after a few
iterations (on Ubuntu 14.04) with

This is Rakudo version 2015.12 built on MoarVM version 2015.12
implementing Perl 6.c.

Am I doing something wrong?

Cheers,
Fritz

-- 
Oetiker+Partner AG  tel: +41 62 775 9903 (direct)
Fritz Zaucker+41 62 775 9900 (switch board)
Aarweg 15+41 79 675 0630 (mobile)
CH-4600 Olten   fax: +41 62 775 9905
Schweiz web: www.oetiker.ch


[perl #127098] [BUG] Unhandled exception in code scheduled on thread 4

2015-12-31 Thread via RT
# New Ticket Created by  Bartłomiej Palmowski 
# Please include the string:  [perl #127098]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=127098 >


3:37 < Rotwang> m: react { Supply.interval(1).tap: -> { .say } }
23:37 <+camelia> rakudo-moar adb160: OUTPUT«Unhandled exception in code
scheduled on thread 4␤»
23:38 < lizmat> Rotwang: agree the error is LTA
23:39 < lizmat> m: react { whenever Supply.interval(1) { .say } }   #
correct syntax
23:39 <+camelia> rakudo-moar adb160:
OUTPUT«(timeout)0␤1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤11␤12␤13␤14␤15␤16␤17␤18␤19␤20␤21␤»


Re: Bug or PEBCAK?

2015-12-31 Thread Parrot Raiser
Thank you.

I'm not sure how to classify this one.  It never occurred to me that a
new Linux installation would NOT include a C compiler. Installing gcc
fixed that.

On 12/31/15, Dominique Dumont  wrote:
> On Wednesday 30 December 2015 19:42:38 Parrot Raiser wrote:
>> probing whether your compiler thinks that it is gcc  Can't compile
>> simple gcc probe, so something is badly wrong at build/probe.pm line
>> 92.
>
> Looks like probe.pm cannot find gcc when trying to compile a small program.
>
>
> HTH
> --
>  https://github.com/dod38fr/   -o- http://search.cpan.org/~ddumont/
> http://ddumont.wordpress.com/  -o-   irc: dod at irc.debian.org
>


[perl #126888] [BUG] list binding hangs

2015-12-31 Thread Christian Bartolomaeus via RT
On Thu Dec 24 19:26:55 2015, zef...@fysh.org wrote:
> This has now been fixed by commit 986f98d8c6d772ac5d0b513793c521df6a343ae8
> from Timo++.
> 
> -zefram

Thanks! I added at test to S32-exceptions/misc.t with commit 
https://github.com/perl6/roast/commit/b0c17ab00c

I'm closing this ticket as 'resolved'.


Re: release?

2015-12-31 Thread Brock Wilcox
On Tue, Dec 29, 2015 at 11:39 AM, webmind  wrote:

>
> Yes, wouldn't it make sense to couple the rakudo release version to the
> language it implements?
>

Naw -- there'll be probably monthly rakudo releases but the Specification
releases should be much less frequent -- like maybe every few months (at
first) or yearly is my guess.

This might be less confusing if:
* We referred more often to rakudo instead of perl6 when we mean the
implementation (you compile with gcc, not "c"; rakudo confusingly calls
it's interpreter "perl6")
* Get more implementations! If we had like 3-4 implementations to choose
from then it might be more obvious what was going on.

Probably there would be a stronger argument for the "perl6" binary to be
either renamed to "rakudo" or to be a symlink to whatever your
current-perl6-implementation is were there an alternative implementation
... but there isn't... so ... I guess someone should do that. :)

... though there actually ARE a few others, but none nearly as complete as
Rakudo, afaik

* https://github.com/sorear/niecza - CLR
* http://fglock.github.io/Perlito/ - Perlito6 written mostly in Perl6 (lots
of other interesting Perlito stuff)
* http://perl6.org/compilers/features - comparison
* several abandoned ones (e.g. Pugs)

--Brock


Re: release?

2015-12-31 Thread Philip Hazelden
Note that if we want scripts to be interpreter-agnostic, the perl6 binary
needs to exist for #! purposes. So renaming it would be bad, but a simlink
would work.

On Thu, Dec 31, 2015 at 2:27 PM Brock Wilcox 
wrote:

> On Tue, Dec 29, 2015 at 11:39 AM, webmind  wrote:
>
>>
>> Yes, wouldn't it make sense to couple the rakudo release version to the
>> language it implements?
>>
>
> Naw -- there'll be probably monthly rakudo releases but the Specification
> releases should be much less frequent -- like maybe every few months (at
> first) or yearly is my guess.
>
> This might be less confusing if:
> * We referred more often to rakudo instead of perl6 when we mean the
> implementation (you compile with gcc, not "c"; rakudo confusingly calls
> it's interpreter "perl6")
> * Get more implementations! If we had like 3-4 implementations to choose
> from then it might be more obvious what was going on.
>
> Probably there would be a stronger argument for the "perl6" binary to be
> either renamed to "rakudo" or to be a symlink to whatever your
> current-perl6-implementation is were there an alternative implementation
> ... but there isn't... so ... I guess someone should do that. :)
>
> ... though there actually ARE a few others, but none nearly as complete as
> Rakudo, afaik
>
> * https://github.com/sorear/niecza - CLR
> * http://fglock.github.io/Perlito/ - Perlito6 written mostly in Perl6
> (lots of other interesting Perlito stuff)
> * http://perl6.org/compilers/features - comparison
> * several abandoned ones (e.g. Pugs)
>
> --Brock
>
>


Re: [perl #127075] Error referencing non-ascii tokens on grammar

2015-12-31 Thread Elizabeth Mattijsen

> On 29 Dec 2015, at 17:35, Rúbio Terra (via RT)  
> wrote:
> 
> # New Ticket Created by  Rúbio Terra 
> # Please include the string:  [perl #127075]
> # in the subject line of all future correspondence about this issue. 
> # https://rt.perl.org/Ticket/Display.html?id=127075 >
> 
> 
> I can declare non-ascii tokens without problems on a grammar but I get an 
> encoding error if I refer to the token using the <> syntax. This happens on 
> MoarVM, it works fine on JVM.
> 
> This runs OK:
> 
>  perl6 -c -e 'grammar { token TOP { + }; token número {<< \d+ >>} }'
>  Syntax OK
> 
> Now, if I reference the new token (número) I get an error:
> 
>  perl6 -c -e 'grammar { token TOP { + }; token número {<< \d+ >>} }'
>  ===SORRY!===
>  Error encoding ASCII string: could not encode codepoint 250
> 
> The same code on JVM runs OK:
> 
>  perl6-j -c -e 'grammar { token TOP { + }; token número {<< \d+ >>} }'
>  Syntax OK
> 
> I'm running Linux Fedora 22. Both Rakudo 2015.11 and 2015.12 exhibit the 
> error.

This looks like it is happening deep in the bowels of NQP:

$ 6l 'grammar { token TOP { + } }'
Error encoding ASCII string: could not encode codepoint 250
   at gen/moar/stage2/NQPP6QRegex.nqp:1382  
(/Users/liz/Github/rakudo.moar/install/share/nqp/lib/NQPP6QRegex.moarvm:capnames:293)
 from gen/moar/stage2/NQPP6QRegex.nqp:1397  
(/Users/liz/Github/rakudo.moar/install/share/nqp/lib/NQPP6QRegex.moarvm:capnames:478)
 from gen/moar/stage2/NQPP6QRegex.nqp:1361  
(/Users/liz/Github/rakudo.moar/install/share/nqp/lib/NQPP6QRegex.moarvm:capnames:52)
 from gen/moar/stage2/NQPP6QRegex.nqp:1313  
(/Users/liz/Github/rakudo.moar/install/share/nqp/lib/NQPP6QRegex.moarvm:qbuildsub:112)

Hope somebody with NQP internals knowledge can pick this up.



Liz

[perl #127106] Junction in regex gives no such attribute '$!pos' error

2015-12-31 Thread via RT
# New Ticket Created by  Leon Timmermans 
# Please include the string:  [perl #127106]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=127106 >


Doing «my $f = any(); say "a" ~~ / $f /;» gives me a «P6opaque: no
such attribute '$!pos'» exception. I'm not sure if this should autothread
or so something smarter, but an exception surely is the wrong thing.


Re: Bug or PEBCAK?

2015-12-31 Thread Dominique Dumont
On Wednesday 30 December 2015 19:42:38 Parrot Raiser wrote:
> probing whether your compiler thinks that it is gcc  Can't compile
> simple gcc probe, so something is badly wrong at build/probe.pm line
> 92.

Looks like probe.pm cannot find gcc when trying to compile a small program. 

HTH
-- 
 https://github.com/dod38fr/   -o- http://search.cpan.org/~ddumont/
http://ddumont.wordpress.com/  -o-   irc: dod at irc.debian.org


[perl #127003] [BUG] DateTime.new screws up comma as decimal point

2015-12-31 Thread Christian Bartolomaeus via RT
On Wed Dec 23 15:00:46 2015, elizabeth wrote:
> 
> Fixed in 18947f4249aa0c11a1f1ac3 , test added with
> 38e988158507ee040ab33e .
> 
> Can be closed.

Great! I'm closing the ticket as 'resolved'.





[perl #127007] [BUG] bad DateTime.Str output for years >9999 and -999 to -1

2015-12-31 Thread Christian Bartolomaeus via RT
On Wed Dec 23 15:52:29 2015, elizabeth wrote:
> 
> Fixed with 895546990f6001a5999ef , tests added with
> 0fa2c59924a35bb41e792
> 
> 
> Can be closed.

Great! I'm closing the ticket as 'resolved'.




[perl #127108] Inexplicable failure of grammar post-CURI branch

2015-12-31 Thread via RT
# New Ticket Created by  Faye 
# Please include the string:  [perl #127108]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=127108 >


There's unfortunately no real diagnostic I can provide for the error 
specifically, since the result of the bug is a failed grammar parse.

The grammar of my SUPERNOVA project (https://github.com/ShimmerFairy/SUPERNOVA) 
has been failing since the CURI branch was merged into mainline rakudo, for 
reasons that are unclear. I can verify that switching to a pre-CURI-merge 
commit (e.g. 6d9d0f11aba8e2f465c2958a9311d9d4016017ff, the last commit before 
the fast-forward merge of CURI) will allow the grammar to work again, with no 
changes to SUPERNOVA, thus it's an issue with rakudo.

My attempt to bisect rakudo led to commit 
ac7b2a5a8381d5f255906437d1980c9c3b77e2a5 
(https://github.com/rakudo/rakudo/commit/ac7b2a5a8381d5f255906437d1980c9c3b77e2a5),
 however as you can see the reason why _this_ commit should break grammar 
parsing is a complete mystery. (I may try bisecting again sometime to confirm 
the result.)

Like I said, there's absolutely nothing I provide in terms of errors, since the 
only indicator is just the grammar suddenly failing to match a valid string. It 
seems to be centered around the "directive" multi token in my grammar, however 
I don't have any more specific info on the location of the issue.


Re: [perl #127107] "duplicate definition of symbol grammar" using Grammar::Tracer in .pm6 file

2015-12-31 Thread mt1957

On 12/31/2015 01:47 PM, Faye (via RT) wrote:

# New Ticket Created by  Faye
# Please include the string:  [perl #127107]
# in the subject line of all future correspondence about this issue.
# https://rt.perl.org/Ticket/Display.html?id=127107 >


$ cat Foo.pm6
use Grammar::Tracer;
$ perl6 -I. -e 'use Foo'
===SORRY!===
P6M Merging GLOBAL symbols failed: duplicate definition of symbol grammar

It appears that, for whatever reason, using Grammar::Tracer from within a 
module file causes that strange low-level error. Note that attempting 'use 
Grammar::Tracer' in a non-module file or directly in one-liners doesn't seem to 
be an issue:

$ perl6 Foo.pm6
$ perl6 -e 'use Grammar::Tracer'
$
See also messages with subject 'lack of info in error message' from 
mt1...@gmail.com


summarized here... (p.s. the test file is from my own project and the 
symbol is defined by using constant)



I get the following error;

perl6 t/070-run-command.t
===SORRY!===
P6M Merging GLOBAL symbols failed: duplicate definition of symbol C-MD5-SIZE

Searching for the symbol gave me exactly one location where it was 
defined. So the error should be more explicit in where it was first 
found and where the second throws the error. In the mean time I found 
that ordering of use statements make a difference after which the error 
disappears.







Re: Jonathan's "Perl 6 Introductory course"

2015-12-31 Thread Sitaram Chamarty
On 31/12/15 20:43, Tom Browder wrote:
> Jonathan's intro course, in pdf, here:
> 
>   https://github.com/rakudo/star/raw/master/docs/2015-spw-perl6-course.pdf
> 
> is excellent, of course.  But I really like the presentation theme and
> the slide formatting!
> 
> Does anyone know what slide-making process he uses?
> 
> So far the best I have found that meets my needs is using asciidoc
> input with Asciidoctor's Deck.js backend. I think I can convert from
> the generated html to pdf but can't say for sure yet, but it is the
> good looks of his slides that I'm primarily interested in.

Looks like Beamer (latex+beamer).

An easy step to beamer is to use pandoc, which is what I use when I need
to make a presentation.  Though it's not as flexible as writing latex
directly, it's pretty decent because with pandoc, your input is just
markdown.  Much (much!) easier on the fingers and on the eyes :)

(Not sure how strict we are on "off-topic" stuff so I will stop here!)



Re: Bug or PEBCAK?

2015-12-31 Thread Brandon Allbery
On Thu, Dec 31, 2015 at 8:55 AM, Parrot Raiser <1parr...@gmail.com> wrote:

>
> I'm not sure how to classify this one.  It never occurred to me that a
> new Linux installation would NOT include a C compiler. Installing gcc
> fixed that.


Normal for Debianoids. "sudo apt-get install build-essential" is one of the
first things I do.
(Also normal for RHEL/Centos but they have no handy metapackage, sigh.)

-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


Re: Jonathan's "Perl 6 Introductory course"

2015-12-31 Thread Tom Browder
On Thu, Dec 31, 2015 at 9:26 AM, Sitaram Chamarty  wrote:
> On 31/12/15 20:43, Tom Browder wrote:
>>   https://github.com/rakudo/star/raw/master/docs/2015-spw-perl6-course.pdf
...
>> Does anyone know what slide-making process he uses?
...
> Looks like Beamer (latex+beamer).
>
> An easy step to beamer is to use pandoc, which is what I use when I need
> to make a presentation.  Though it's not as flexible as writing latex
> directly, it's pretty decent because with pandoc, your input is just
> markdown.  Much (much!) easier on the fingers and on the eyes :)

Great info, Sitaram, thanks so much!

...Oops, I see several paths leading there.  Any hints on your work flow?

Best regards,

-Tom


Re: $epsilon = 1.0e-6 feels too big for Rat()

2015-12-31 Thread James Ellis Osborne III
Considering that the Chinese 5th Century is 1849, I would expect
http://babel.hathitrust.org/cgi/pt?id=mdp.39015046627348 to present
less zuo.

-jas

On 31 December 2015 at 03:48, Darren Duncan  wrote:
> Considering that a non-fat Rat has a 64-bit denominator, I would expect
> conversions from Num to make use of that full precision by default, and not
> round off to 6 decimal places. -- Darren Duncan
>


Re: Jonathan's "Perl 6 Introductory course"

2015-12-31 Thread Tom Browder
Thanks Sitaram and Moritz!

-Tom


Re: Jonathan's "Perl 6 Introductory course"

2015-12-31 Thread Sitaram Chamarty
On 31/12/15 21:26, Tom Browder wrote:
> On Thu, Dec 31, 2015 at 9:26 AM, Sitaram Chamarty  wrote:
>> On 31/12/15 20:43, Tom Browder wrote:
>>>   https://github.com/rakudo/star/raw/master/docs/2015-spw-perl6-course.pdf
> ...
>>> Does anyone know what slide-making process he uses?
> ...
>> Looks like Beamer (latex+beamer).
>>
>> An easy step to beamer is to use pandoc, which is what I use when I need
>> to make a presentation.  Though it's not as flexible as writing latex
>> directly, it's pretty decent because with pandoc, your input is just
>> markdown.  Much (much!) easier on the fingers and on the eyes :)
> 
> Great info, Sitaram, thanks so much!
> 
> ...Oops, I see several paths leading there.  Any hints on your work flow?

The basic stuff is fairly simple, and the pandoc site has decent help.
It's basically markdown, except a simple (non-standard-markdown) syntax
for the title and the author.  Then you run a command like `pandoc -i
foo.mkd -o foo.pdf -t beamer -V theme:Darmstadt [...]`.

Note that pandoc can't do things like vertical split slides, etc.
(AFAIK), and I've never really tried to figure out how to change the
colors, fonts, etc., either.

The nice thing about pandoc is that it can write several different
formats; see [1] for an example that uses the "HTML Slidy" format.  (The
pictures are done by graphviz, not pandoc, as you will probably guess
when you see it.)

[1]: http://gitolite.com/gcs.html


Re: Jonathan's "Perl 6 Introductory course"

2015-12-31 Thread Moritz Lenz


On 12/31/2015 04:26 PM, Sitaram Chamarty wrote:
> On 31/12/15 20:43, Tom Browder wrote:
>> Jonathan's intro course, in pdf, here:
>> 
>>   https://github.com/rakudo/star/raw/master/docs/2015-spw-perl6-course.pdf
>> 
>> is excellent, of course.  But I really like the presentation theme and
>> the slide formatting!
>> 
>> Does anyone know what slide-making process he uses?
>> 
>> So far the best I have found that meets my needs is using asciidoc
>> input with Asciidoctor's Deck.js backend. I think I can convert from
>> the generated html to pdf but can't say for sure yet, but it is the
>> good looks of his slides that I'm primarily interested in.
> 
> Looks like Beamer (latex+beamer).

The meta data of the PDF agrees, it says "LaTeX with Beamer class
version 3.10" in the "creator" field.

Cheers,
Moritz


Re: c99 hexadecimal floating point support?

2015-12-31 Thread Patrick R. Michaud
On Thu, Dec 31, 2015 at 04:13:40PM +0900, Dan Kogai wrote:
> Anyway, is there a plan to support hexadecimal floating point support?
> % perl6 -e 'say 0x1.921fb54442d18p+1'
> ===SORRY!=== Error while compiling -e
> Malformed postfix call
> at -e:1
> --> say 0x1.⏏921fb54442d18p+1

$ ./perl6 -e 'say :16<1.921fb54442d18*2**1>'
3.1415926535897931

$ ./perl6 -e 'say :16<3.243F6A8885A3>'
3.1415926535897931

> FYI Perl5 has started supporting since 5.22.

Fractional values of any radix have been in the Perl 6 design for years, and I 
suspect Rakudo has implemented it for at least 2-3 years, if not longer.

Note that the values listed above are not "floating point" (Num) -- they're 
Rats.  If you're looking specifically for the c99 hex float notation itself... 
no, Perl 6 doesn't have that AFAIK.

Pm


[perl6/specs] 7a0988: Make an allowance for future META6 versioning

2015-12-31 Thread GitHub
  Branch: refs/heads/master
  Home:   https://github.com/perl6/specs
  Commit: 7a09880494d5a26b75023904a55dd5dd1df7e96c
  
https://github.com/perl6/specs/commit/7a09880494d5a26b75023904a55dd5dd1df7e96c
  Author: Anthony Parsons 
  Date:   2015-12-31 (Thu, 31 Dec 2015)

  Changed paths:
M S22-package-format.pod

  Log Message:
  ---
  Make an allowance for future META6 versioning

This doesn't break any existing code. I promise!




[perl6/specs] 60cf34: Stringy versions shouldn't be /^v/, jdv79++

2015-12-31 Thread GitHub
  Branch: refs/heads/master
  Home:   https://github.com/perl6/specs
  Commit: 60cf346f640a2ca50cd8712315f3b4df453fe48b
  
https://github.com/perl6/specs/commit/60cf346f640a2ca50cd8712315f3b4df453fe48b
  Author: Anthony Parsons 
  Date:   2015-12-31 (Thu, 31 Dec 2015)

  Changed paths:
M S22-package-format.pod

  Log Message:
  ---
  Stringy versions shouldn't be /^v/, jdv79++




[perl #127110] Error message for setting ro attribute inside a trait_mod: sub is LTA

2015-12-31 Thread via RT
# New Ticket Created by  Dave Rolsky 
# Please include the string:  [perl #127110]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=127110 >


Given this code:

-
use v6;

my role R {
has $.thing;
}

multi sub trait_mod: (Attribute:D $attr, :$whatever) {
$attr does R;
$attr.thing = 42;
}

class C {
has $.val is whatever;
}


I get this error:


===SORRY!=== Error while compiling 
/home/autarch/projects/perl6/MetaX-Attribute-LazyBuild/./foo
Cannot modify an immutable Any
at /home/autarch/projects/perl6/MetaX-Attribute-LazyBuild/./foo:13


There are two problems here. One is that the line number is unhelpfully 
pointing at the line where I declare "has $.val is whatever" and the second is 
that I'm not being told what exact "immutable Any" can't be modified.

It'd be greatly preferable to get an error like "Cannot set immutable attribute 
thing on $attr at ...foo:9"


Re: [perl #127102] GC error with NativeCall: Internal error: invalid thread ID ######## in GC work pass

2015-12-31 Thread Elizabeth Mattijsen
> On 31 Dec 2015, at 08:42, William Herrera (via RT) 
>  wrote:
> 
> # New Ticket Created by  William Herrera 
> # Please include the string:  [perl #127102]
> # in the subject line of all future correspondence about this issue. 
> # https://rt.perl.org/Ticket/Display.html?id=127102 >
> 
> 
> This bug (a MoarVM bug or ?) occurs while using 32-bit perl6 (MoarVM, no 
> JIT), perl6 version 2015.09 built on MoarVM version 2015.09.
> 
> It occurs while using NativeCall to call a proprietary 32-bit .dll in Windows 
> 10, which is being used for a specialized BIOS hardware interface, so the 
> source will not work on a generic Windows setup.
> 
> This native call works under Julia with similar parameters. The code "works" 
> without an error trap if the line for the native call, which is the line
> AsWMI_DeviceControl($pos, $colr +& 0xff);
> 
> which does the NativeCall to 
> sub AsWMI_DeviceControl(int32, int32) is native("ACPIWMI") { * }
> 
> is commented out, so it is not in the other code.
> 
> In perl6, the code exits after about 50 calls with the error message:
> 
> ==
> Internal error: invalid thread ID 31457303 in GC work pass
> ==
> 
> The thread ID varies from run to run, but the error consistently occurs after 
> about 15 seconds of calling about 4 times a second. Before the error, the 
> call works properly, setting the hardware without problems.
> 

A *lot* has happened in rakudo since 2015.09.  Could you please check if the 
problem still exists with 2015.12 or later?  Thank you!



Liz

[perl #123766] [META] Tickets blocking the 2015 release of Perl 6

2015-12-31 Thread Will Coleda via RT
Christmas was released!

Resolving ticket.

-- 
Will "Coke" Coleda