Re: Fwd: Working with a regex using positional captures stored in a variableperl6-us...@perl.org

2021-03-11 Thread Moritz Lenz
and then interpolated into a regex. > > Do capture groups need to be defined at the top level where the > regex is used? > > { # From a code example in the "Parsing" book by Moritz Lenz, p. 48, > section 5.2 >my $input = 'There are 9 million bicycles in b

[perl #125555] [NYI] Comparison ops for DateTimes in Rakudo

2018-02-05 Thread Moritz Lenz via RT
Tests added in https://github.com/perl6/roast/commit/ff0472adfc

Re: Where is "Subject"?

2017-02-23 Thread Moritz Lenz
contains both the headers and the body ($email in the README), and the subject is part of the headers. The only reason that $from and @to have a separate interface is that SMTP handles them separately. Cheers, Moritz -- Moritz Lenz https://deploybook.com/ -- https://perlgeek.de/ -- https://perl6.org/

Re: per 5 converter?

2017-02-12 Thread Moritz Lenz
ry to stay away from it. Cheers, Moritz On 12.02.2017 07:47, ToddAndMargo wrote: > Hi All, > > I know I asked this once before and I had though I'd written it > down, but do you have any favorite Perl5 to Per6 converters? > > Many thanks, > -T > -- Morit

Re: [perl #130638] [LTA] X::Seq don't say which Seq the exception occurred on

2017-01-25 Thread Moritz Lenz
> >> Cheers, >> Mority >> >> > > I don't want the values of the Seq, I want the name of the variable. Trying to find the name of a variable (if there is one at all) from the object is inherently brittle, and has lead to many false positives in the past (like reporting the name of a parameter from a routine in CORE somewhere). -- Moritz Lenz https://deploybook.com/ -- https://perlgeek.de/ -- https://perl6.org/

Re: mocking $*OUT

2017-01-24 Thread Moritz Lenz
y > the code above doesn't work. Any ideas? Because say() is a high-level function that uses the lower-level $*OUT.print under the hood. >From rakudo's src/core/io_operators.pm: multi sub say(Str:D \x) { my $out := $*OUT; $out.print(nqp::concat(nqp::unbox_s(x),$out.nl-out)); }

Re: A stricter typed variable

2017-01-07 Thread Moritz Lenz
onstraint, ask yourself: could there be an object from another type that my could would also work with? Maybe I'm just calling a method that's implemented in type Str, but a user-supplied object could implement the same method as well. If it walks like a duck, and quacks like a duck, d

Re: A stricter typed variable

2017-01-07 Thread Moritz Lenz
= 'gzip', 'uuencode'; or even test format => 'gnutar', filter => my Str @ = ; My general advise is to not exaggerate the usage of container types. Think of Perl 6 as a dynamically typed language, and only add types where they make life easier for everybody involved. Cheers, Moritz -- Moritz Lenz https://deploybook.com/ -- https://perlgeek.de/ -- https://perl6.org/

[perl #130396] [BUG] =:= operation aginst item contextualized object returns incorrect result

2016-12-23 Thread Moritz Lenz via RT
This is not a bug. $b is a container that contains the array @a, so @a !=:= $b. : An easy test is assigning to $b, and see if it's reflected in @a: $ perl6 -e 'my @a = 1,2; my $b = @a.item; $b = 42; say @a' [1 2]

Re: [perl #130371] [REGRESSION] return in block does not return from sub that is parameterised with that block

2016-12-18 Thread Moritz Lenz
pretty sure that's not a bug; &return is supposed to be tied to the lexically outer Routine, and in this example, there is no lexically outer Routine, so the error message is valid. Cheers, Moritz -- Moritz Lenz https://deploybook.com/ -- https://perlgeek.de/ -- https://perl6.org/

Re: Need some help to understand how modify an AST.

2016-12-05 Thread Moritz Lenz
> This program displays an error message and doesn't find the value of > toto environment variable. > > > The only difference between the 2 programs is instruction "make( > %*ENV{$}" is part of the TOP method in the program 1 and > part of the varenv method in program 2. > > I'm certainly missing something but I don't understand why program 2 > doesn't work. I'm very interested to get explanations for that. It will > help me to understand how to modify and AST using Perl6. > > > Thanks a lot for your help. > > Best regards, > > Jean-Pierre > > -- Moritz Lenz https://deploybook.com/ -- https://perlgeek.de/ -- https://perl6.org/

Re: What is rakudo-star?

2016-11-18 Thread Moritz Lenz
On 19.11.2016 03:14, _ ifdog wrote: > So why there is not a star release of 2016.10 for windows ? Because nobody one yet. I'm happy to upload it for you if you provide it. Cheers, Moritz -- Moritz Lenz https://deploybook.com/ -- https://perlgeek.de/ -- https://perl6.org/

Re: Where to start?

2016-11-18 Thread Moritz Lenz
rogram in Linux. #!/usr/bin/env /path/to/your/rakudo/inst/bin/perl6 use v6; > Also, do I need to run perl6 through a compiler or > does it compile on the fly like perl 5? There's no separate compilation step. Cheers, Moritz -- Moritz Lenz https://deploybook.com/ -- https://perlgeek.de/ -- https://perl6.org/

Re: What's involved in the creation of a new Rakudo * version?

2016-10-16 Thread Moritz Lenz
e is: https://github.com/rakudo/star/blob/master/tools/star/release-guide.pod Cheers, Moritz -- Moritz Lenz https://deploybook.com/ -- https://perlgeek.de/ -- https://perl6.org/

Re: think I found a bug in the doc's

2016-10-04 Thread Moritz Lenz
$mod)returns Int:D it needs > three parameters Yes, that's right. If you tell me your github username, I can give you access so that you can change it directly on https://github.com/perl6/doc/. Otherwise a pull request would be very welcome. Cheers, Moritz -- Moritz Lenz https://deploybook.com/ -- https://perlgeek.de/ -- https://perl6.org/

Re: What are variables/parameters that start with a pipe | char

2016-10-01 Thread Moritz Lenz
ot;| (parameter)", which points to relevant documentation. Cheers, Moritz -- Moritz Lenz https://deploybook.com/ -- https://perlgeek.de/ -- https://perl6.org/

Re: Sorting Multidimentional Arrays

2016-10-01 Thread Moritz Lenz
For the record, you can simplify this a bit: @opposite = @opposite.sort(*[3]); > for @opposite -> $line { say $line; } > --- > > I have adapted this from: > http://www.wellho.net/resources/ex.php?item=p600/mapper > > I wanted to ask about the syntax, buy I have understood

Re: unicode

2016-09-17 Thread Moritz Lenz
.0 docs/ChangeLog in MoarVM says + Updated to Unicode 8 in the section of the 2015.07 release, so it's not that bad :-) Cheers, Moritz -- Moritz Lenz https://deploybook.com/ -- https://perlgeek.de/ -- https://perl6.org/

Re: grammars and indentation of input

2016-09-13 Thread Moritz Lenz
t that has gone into it. Cheers, Moritz -- Moritz Lenz https://deploybook.com/ -- https://perlgeek.de/ -- https://perl6.org/

Re: Inline::Python panda installation fails

2016-07-13 Thread Moritz Lenz
Hi, On 07/13/2016 11:01 AM, The Holy Ghost wrote: On linux 2016.04 and windows 2016.01 : ==> Fetching Inline::Python ==> Building Inline::Python gcc pyhelper.c -Wall -I"/usr/include/python2.7" -L"/usr/lib/python2.7/config" -lpython2.7 -shared -o /home/erana/.panda-work/1468400277_1/resources/

Re: [perl #128428] [BUG] Behaviour of div / mod on Non-Ints

2016-06-20 Thread Moritz Lenz
Hi, On 06/18/2016 12:39 AM, Zoffix Znet (via RT) wrote: # New Ticket Created by Zoffix Znet # Please include the string: [perl #128428] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=128428 > Current implementation of `mod` h

Re: NativeCall interface for a char ** argument

2016-05-27 Thread Moritz Lenz
Hi, On 25.05.2016 17:35, Fernando Santagata wrote: > Hello, > > Please excuse my naivety, I'm trying to use NativeCall to interface a > Perl6 program with a C library and I have a problem mapping a char ** > argument. > > The C function has this prototype: > > void function(char **arg1, char **

Re: How to capture an div 0 exception

2016-05-18 Thread Moritz Lenz
On 05/18/2016 01:39 PM, mt1957 wrote: On 18-05-16 13:07, Richard Hainsworth wrote: use v6; my $d = 1; my $e = 2; my $f = 0; #my $r; my $r = 5; CATCH { # when X::AdHoc { when Exception { .Str.say; # $r = 5; .resume } } $r = try { ( $d + $e ) / $f; }; # my $r = try EVAL '

Re: Fwd: perl6 INC

2016-05-11 Thread Moritz Lenz
On 05/11/2016 04:30 PM, Bennett Todd wrote: Thanks for the explanation. Sounds like an unfortunate situation, rather than letting the system admin choose modules within the limits of filesystem namespace, it's using a separate database, opaque to filesystem tools. I hope this is just a tempor

Re: Unwanted failure and FAILGOAL

2016-05-11 Thread Moritz Lenz
Hi, On 05/11/2016 07:45 AM, Richard Hainsworth wrote: I have the following in a grammar rule TOP{ ^ + $ }; rule statement { '=' | { { self.panic($/, "Declaration syntax incorrect") } } }; rule endvalue { '(' ~ ')'

Re: Work around to "unwanted fail"

2016-05-11 Thread Moritz Lenz
Hi, On 05/11/2016 09:22 AM, Richard Hainsworth wrote: I had grammar RatingGrammar { rule TOP{ ^ + $ }; rule statement { '=' | { if ($/.CURSOR.pos < $/.orig.chars) { self.panic($/, "Declar

Re: DBIish: Why can't I interpolate variable holding database name?

2016-05-01 Thread Moritz Lenz
On 01.05.2016 15:36, James E Keenan wrote: > > Thanks; that worked: > > # > cat dbiish_connect_dynamic_3.pl6 > #!/usr/bin/env perl6 > use DBIish; > > my $db = 'hierarchy'; > my $dbh = DBIish.connect("Pg", :database($db)); Another nice little language feature is that you can reuse the name o

Re: question about Supply.act()

2016-04-28 Thread Moritz Lenz
On 04/28/2016 11:11 AM, mt1957 wrote: Hi, The documentation about the method act explains that 'the given code is guaranteed to be only executed by one thread at a time'. Can I assume from this that any other thread including the main thread isn't running? No. Other threads might still be run

Re: Perl 6 pod-handling code seems widely scattered

2016-04-27 Thread Moritz Lenz
On 04/25/2016 03:27 PM, Tadeusz Sośnierz wrote: On 25/04/16 14:13, Tom Browder wrote: I would like to hack on the pod handling code (particularly the HTML generation) but it seems to be quite scattered around github. Is http://github.com/perl6/Pod::To::HTML>> the definitive repo location for th

Re: [perl #127890] [IMPROVEMENT PROPOSAL] Test.pm6 make subtest multi to take description first

2016-04-13 Thread Moritz Lenz
Hi, On 04/13/2016 02:52 PM, Zoffix Znet (via RT) wrote: # New Ticket Created by Zoffix Znet # Please include the string: [perl #127890] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=127890 > Hey, I propose we make Test.pm6'

Re: [perl #127878] UTF8-C8 + Str.subst either dumps core or corrupt memory

2016-04-12 Thread Moritz Lenz
On 11.04.2016 17:00, Moritz Lenz wrote: > On 04/11/2016 03:04 PM, Nicholas Clark wrote: >> On Mon, Apr 11, 2016 at 04:39:59AM -0700, H. Merijn Brand wrote: >> >>> In a one-liner: >>> >>> $ p6 -e'my$b=Buf.new(61,^2048 .map({256.rand.Int}));my Str

Re: [perl #127878] UTF8-C8 + Str.subst either dumps core or corrupt memory

2016-04-11 Thread Moritz Lenz
On 04/11/2016 03:04 PM, Nicholas Clark wrote: On Mon, Apr 11, 2016 at 04:39:59AM -0700, H. Merijn Brand wrote: In a one-liner: $ p6 -e'my$b=Buf.new(61,^2048 .map({256.rand.Int}));my Str $u=$b.decode("utf8-c8");$u.=subst(/("a"|"b")/,{"c$0"},:g);' Segmentation fault or (same code) With timot

[perl #66820] Null PMC access in find_method() while accessing bound return value from gather/take

2016-03-12 Thread Moritz Lenz via RT
On Sun Jun 21 11:24:57 2009, moritz wrote: > $ perl6 -e 'my @a := gather { for 1..3 { take $_; say @a.perl } }; say > @a.perl' > Null PMC access in find_method() > in Main (:1) Current behavior: Type check failed in binding; expected Positional but got Seq (?) If I change it to 'my \a = gather

Re: Confused about rakudobrew and Rakudo Star

2016-02-08 Thread Moritz Lenz
On 02/06/2016 12:37 AM, Brock Wilcox wrote: Also note that in my listing I installed a specific rakudo release, the one that is included in the star tarball. That way further rakudo releases are irrelevant. There's a contradiction in terms here: if there were no Rakudo releases, you couldn't s

Re: Installing both from rakudobrew and Rakudo Star

2016-02-05 Thread Moritz Lenz
On 02/05/2016 01:57 AM, James E Keenan wrote: Follow-up questions to those I posed on perl6-users today. So I have successfully used rakudobrew to build moar and panda. That perl6 executable is located here: $ which perl6 /home/jkeenan/.rakudobrew/bin/perl6 Now, suppose I *also* wish to inst

Re: Confused about rakudobrew and Rakudo Star

2016-02-04 Thread Moritz Lenz
Hi, On 02/04/2016 01:44 PM, Brock Wilcox wrote: If my understanding is correct (might not be), the tarball should be ALMOST equivalent to: rakudobrew build moar 2016.01.1 # Install rakudo 2016.01.1 rakudobrew global 2016.01.1 # Make this the default rakudobrew build p

Re: Confused about rakudobrew and Rakudo Star

2016-02-04 Thread Moritz Lenz
On 02/04/2016 01:26 PM, James E Keenan wrote: On 02/03/2016 10:48 PM, Brandon Allbery wrote: On Wed, Feb 3, 2016 at 10:30 PM, James E Keenan wrote: I am evidently confused as to the relationship, if any, between the 'rakudobrew' utility and the Rakudo::Star distribution. In short: rakudo

Re: Rationale for $!

2016-01-28 Thread Moritz Lenz
Hi, On 01/28/2016 04:06 PM, Todd C. Olson wrote: > Is there a way to make the exception be thrown eagerly, at the devision > statement rather than waiting until use, at the say statement? Yes, 'use fatal;' Cheers, Moritz

Re: Rationale for $!

2016-01-27 Thread Moritz Lenz
On 01/27/2016 04:32 PM, Felipe Gasper wrote: On 27 Jan 2016 10:15 AM, Moritz Lenz wrote: On 01/27/2016 03:15 PM, Felipe Gasper wrote: So, what *is* the scoping of $!? Scoped to a routine, iirc (sub, method, regex) Interesting. JavaScript programmers that I’ve known bemoan that their

Re: Rationale for $!

2016-01-27 Thread Moritz Lenz
On 01/27/2016 03:15 PM, Felipe Gasper wrote: So, what *is* the scoping of $!? Scoped to a routine, iirc (sub, method, regex)

Re: Rationale for $!

2016-01-27 Thread Moritz Lenz
Hi, On 01/27/2016 07:17 AM, Felipe Gasper wrote: Hello, What is the purpose of having $! in Perl 6? The global variables in Perl 5 are a constant headache, prompting us to need to local()ize variables like $@, $!, and $? to avoid unforeseen consequences like RT #127386 and those docu

Re: Is there another way to define a regex?

2016-01-17 Thread Moritz Lenz
On 01/17/2016 06:07 PM, Tom Browder wrote: > I'm trying to write all new Perl code in Perl 6. One thing I need is > the equivalent of the Perl 5 qr// and, following Perl 6 docs, I've > come to use something like this (I'm trying to ignore certain > directories): > > # regex of dirs to ignore >

Re: [perl #127263] Cannot pass a Method object to .^can

2016-01-14 Thread Moritz Lenz
Hi Dave, On 01/14/2016 07:47 AM, Dave Rolsky (via RT) wrote: # New Ticket Created by Dave Rolsky # Please include the string: [perl #127263] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=127263 > If I do a get errors like:

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

Re: Constants as members of a class

2015-12-18 Thread Moritz Lenz
Hi, On 12/18/2015 03:46 AM, TS xx wrote: > Hello dear perl6 users, > > I was in the need of declaring a member variable as a constant integer. I don't understand this. If it's a constant, why does it need to be member at all? A member is per-instance storage, which seems to be a waste for a cons

Re: Gather/take & return, PHP7-style

2015-12-10 Thread Moritz Lenz
On 12/09/2015 07:35 PM, yary wrote: This feature builds upon the generator functionality introduced into PHP 5.5. It enables for a return statement to be used within a generator to enable for a final expression to be returned (return by reference is not allowed). This value can be fetched using t

Announce: Rakudo Star Release 2015.11

2015-11-28 Thread Moritz Lenz
On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the November 2015 release of "Rakudo Star", a useful and usable distribution of Perl 6. The tarball for the November 2015 release is available from . This Rakudo Star release comes with s

Re: &MAIN signature to preserve @*ARGFILES ?

2015-11-28 Thread Moritz Lenz
Hi, On 11/28/2015 05:49 PM, Marc Chantreux wrote: > hello, > > i would like to write a better version of the unix `column` with some > options like 'preserve separator' so i started to write it down. > > sub padded-cols ($sep,@sheet) { > my $fmt = > join $sep, > @sheet[0].key

Re: [perl #126664] .roll on a Range of Num ain't random

2015-11-27 Thread Moritz Lenz
On 11/26/2015 03:36 PM, Wenzel P. P. Peppmeyer wrote: On Thu, 26 Nov 2015, Elizabeth Mattijsen via RT wrote: (0.1 .. 0.3).roll(10).say; What did you expect? a selection of 0.1, 0.2, 0.3 ?? or 10 random values between 0.1 and 0.3 inclusive? I would (naive) expect 10x a value between 0.1

Re: confused about 'try'

2015-11-24 Thread Moritz Lenz
Hi, On 11/24/2015 06:39 AM, brad clawsie wrote: > Been playing with perl6 and it is truly amazing. > > I'm somewhat confused as to when I should should wrap subroutine > invocations with `try`. My `CATCH` clauses seem to be able to catch > thrown Exception instances if I use `try` or not. That's

Re: combine hashes

2015-11-07 Thread Moritz Lenz
On 11/07/2015 10:17 AM, Marc Chantreux wrote: > hello Moritz, > > On Sat, Nov 07, 2015 at 08:17:21AM +0100, Moritz Lenz wrote: >> my %x = < login jdoe first john last doe >; >> my %y = flat (:enable, %x< login first >:p); > > i tried :p but the thing is i

Re: combine hashes

2015-11-06 Thread Moritz Lenz
Hi, On 11/07/2015 02:45 AM, Marc Chantreux wrote: > hello, > > using perl6 version 2015.09 built on MoarVM version 2015.09, > i'm trying to create a hash with a slice of another one and some extra > pairs. as exemple: > > my %x = < login jdoe first john last doe >; > my %y = :enable, |

Re: Ecosystem problems

2015-11-02 Thread Moritz Lenz
Hi, On 11/02/2015 05:22 AM, Richard Hainsworth wrote: > Dear All, > > I'm working on a sort of citation index of Perl6 modules. One general > problem: > > There are two modules in the ecosystem, viz. io-prompt and lolsql, that > do not have ether META.info or META6.json file. > > This is prob

Re: Missing documentation

2015-10-29 Thread Moritz Lenz
On 10/29/2015 09:14 AM, Steve Mynott wrote: > I renamed it to 5to6-nutshell.html. ... and I created a redirect from 5to6 to 5to6-nutshell: https://github.com/perl6/doc/commit/df1b189dec Cheers, Moritz

Re: How to call a super class method?

2015-10-28 Thread Moritz Lenz
On 10/28/2015 08:03 AM, Patrick R. Michaud wrote: On Wed, Oct 28, 2015 at 03:31:09AM +, TS xx wrote: Can I call the Person's constructor (in non static context), pass the required parameter and do more things before returning? There are two answers to this question, both of which likely

Re: How to profile Perl 6 applications?

2015-10-24 Thread Moritz Lenz
Hi, On 10/24/2015 09:52 AM, Timo Paulssen wrote: > On 24/10/15 09:40, Moritz Lenz wrote: >> Hi Gabor, >> >> On 10/24/2015 09:26 AM, Gabor Szabo wrote: >>> The Devel::NYTProf helped me a lot locating the source of slowness on >>> the Perl Maven site. >>

Re: Forking or running external process in background

2015-10-24 Thread Moritz Lenz
On 10/24/2015 10:06 AM, Gabor Szabo wrote: > I am trying to test the Perl6::Maven web application by launching the > full application (which is uses Bailador) and then accessing the pages > using LWP::Simple. > > > Unfortunately so far I could not figure out how to launch an external > program

Re: How to profile Perl 6 applications?

2015-10-24 Thread Moritz Lenz
Hi Gabor, On 10/24/2015 09:26 AM, Gabor Szabo wrote: > The Devel::NYTProf helped me a lot locating the source of slowness on > the Perl Maven site. > Is there something similar for Perl 6 so I can try to improve the speed > of the Perl 6 Maven site too? Rakudo has a --profile command line option,

Re: Backwards compatibility and release 1.0

2015-10-15 Thread Moritz Lenz
On 10/15/2015 10:47 AM, Smylers wrote: Moritz Lenz writes: On 10/13/2015 10:52 AM, Richard Hainsworth wrote: Following on the :D not :D thread, something odd stuck out. On 10/13/2015 03:17 PM, Moritz Lenz wrote: We have 390+ modules, and hand-waving away all trouble of maintaining them

Re: Backwards compatibility and release 1.0

2015-10-14 Thread Moritz Lenz
On 10/13/2015 10:52 AM, Richard Hainsworth wrote: Following on the :D not :D thread, something odd stuck out. On 10/13/2015 03:17 PM, Moritz Lenz wrote: But hopefully none of them breaking backwards compatibility on such a large scale. The last few backwards incompatible changes still cause

Re: To :D or not to :D

2015-10-13 Thread Moritz Lenz
On 10/12/2015 09:51 PM, Mark Overmeer wrote: * Moritz Lenz (mor...@faui2k3.org) [151012 15:32]: . are they using :D correctly? Yes, though not everybody uses :D as much as they do. Do you check that all the parameters that your Perl 5 methods/subs receive are defined? If not, you

Re: To :D or not to :D

2015-10-12 Thread Moritz Lenz
Hi, On 10/12/2015 03:41 PM, Mark Overmeer wrote: > > Hi all, > > Liz and Tux demonstrate powerful Perl6 code at each monthly meeting of > our Mongers in Amsterdam. Looking at their examples, I collected a few > questions of which I want to discuss the first one in this thread. > > > When I lo

Re: [perl #126208] [BUG] Many threads results in data corruption

2015-09-28 Thread Moritz Lenz
On 09/27/2015 11:58 PM, Benjamin Goldberg (via RT) wrote: # New Ticket Created by Benjamin Goldberg # Please include the string: [perl #126208] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=126208 > The code at https://gist.

Re: Misunderstanding when usng elems on undefined Array

2015-09-28 Thread Moritz Lenz
Hi, On 09/25/2015 05:46 PM, mt1957 wrote: Found the following using Array; > my Array $a; > say $a.elems; 1 > $a.push(1) [1] > say $a.perl [1] > say $a.elems 1 > my Array $a .= new; [] > say $a.elems; 0 Seems that an uninitialized Array reports one element but pushing values on the ar

Announce: Rakudo Star Release 2015.09

2015-09-26 Thread Moritz Lenz
On behalf of the Rakudo and Perl 6 development teams, I'm excited to announce the September 2015 release of "Rakudo Star", a useful and usable distribution of Perl 6. The tarball for the September 2015 release is available from . This Rakudo Star release comes wi

Re: require on string stopped working in rakudo 2015.09

2015-09-26 Thread Moritz Lenz
On 09/26/2015 01:07 PM, Elizabeth Mattijsen wrote: >> On 26 Sep 2015, at 06:47, Gabor Szabo wrote: >> I am really glad Rakudo finally came out. >> I've installed in and tried to run the tests of Perl6::Maven. >> >> They quickly failed as I have been using 'require' on string >> to check if all t

Re: Method 'send' not found for invocant of class 'IO::Socket::INET'

2015-09-26 Thread Moritz Lenz
Hi, method .send was deprecated in favor of .print (for strings) and .write (with bufs/blobs) Maybe Bailador or one of its dependencies needs updating. Cheers, Moritz

Re: How to push a hash on an array without flattening it to Pairs?

2015-09-26 Thread Moritz Lenz
On 09/26/2015 02:26 PM, Aristotle Pagaltzis wrote: > Now of course I must ask – is there an opposite also? I.e. when writing > a list, is there a way I can say “do flatten this item?” Yes, that's what type Slip is for: http://doc.perl6.org/type/Slip It's useful for returning more than one list

Re: require on string stopped working in rakudo 2015.09

2015-09-26 Thread Moritz Lenz
Hi, On 09/26/2015 06:47 AM, Gabor Szabo wrote: > Hi, > > I am really glad Rakudo finally came out. > I've installed in and tried to run the tests of Perl6::Maven. > > They quickly failed as I have been using 'require' on string > to check if all the module compile properly. > > The following co

Re: How to push a hash on an array without flattening it to Pairs?

2015-09-26 Thread Moritz Lenz
Hi, On 09/26/2015 07:58 AM, Gabor Szabo wrote: > In the first two cases the hash was converted to Pairs before assigning > to the array. > Only the third case gave what I hoped for. How can I push a hash onto an > array as a single entity? > > > use v6; > > my %h = x => 6, y => 7; > say %h.perl

perl6-all@perl.org

2015-09-20 Thread Moritz Lenz
On 09/20/2015 09:55 AM, Tobias Leich (via RT) wrote: > # New Ticket Created by Tobias Leich > # Please include the string: [perl #126113] > # in the subject line of all future correspondence about this issue. > # https://rt.perl.org/Ticket/Display.html?id=126113 > > > > t/spec/S02-names/pseud

Re: What are Perl 6's killer advantages over Perl 5?

2015-08-26 Thread Moritz Lenz
Hi, On 11.08.2015 14:12, Tom Browder wrote: I have seen several lists of new Perl 6 features (versus Perl 5) but they all seem to be lists that intermix features with varying degrees of value to "ordinary" Perl 5 users. If one wants to sell long-time Perl 5 users (already using the latest Perl

Re: [perl #125745] Custom infix:<~~> multi not used by rakudo

2015-08-03 Thread Moritz Lenz
Hi, On 04.08.2015 00:52, Faye (via RT) wrote: # New Ticket Created by Faye # Please include the string: [perl #125745] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=125745 > m: class Foo { }; multi sub infix:<~~>(Foo $a, Fo

Re: Is < > creating and Array or Parcel ?

2015-08-02 Thread Moritz Lenz
Hi, On 02.08.2015 06:43, Gabor Szabo wrote: On Fri, Jul 31, 2015 at 4:16 PM, Moritz Lenz mailto:mor...@faui2k3.org>> wrote: On 07/31/2015 03:02 PM, Gabor Szabo wrote: The following code (with comments) is confusing me. Can someone give some explanation

Re: Is < > creating and Array or Parcel ?

2015-07-31 Thread Moritz Lenz
On 07/31/2015 03:02 PM, Gabor Szabo wrote: The following code (with comments) is confusing me. Can someone give some explanation please? Specifically the difference between my @x = ; It's the assignment to the Array variable that makes the Array here; < > by itself just creates a Parcel:

Announce: Rakudo Star Release 2015.07

2015-07-27 Thread Moritz Lenz
A useful, usable, "early adopter" distribution of Perl 6 On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the July 2015 release of "Rakudo Star", a useful and usable distribution of Perl 6. The tarball for the July 2015 release is available from

Re: perl6/book fonts: why Adobe commercial fonts?

2015-07-22 Thread Moritz Lenz
Hi, On 07/23/2015 01:03 AM, Tom Browder wrote: Is there any reason to use Adobe commercial fonts for the book? As I read the instructions to copy fonts from Adobe Reader, I worry that that is prohibited by the license from Adobe. Building the book without the fonts results in an ugly book in s

Re: Passing a hash to a subroutine: best method?

2015-07-03 Thread Moritz Lenz
On 07/03/2015 10:02 PM, yary wrote: > On Fri, Jul 3, 2015 at 3:03 PM, Timo Paulssen wrote: >> but this does not >> >>> sub takes_int_array(Int @bar) { say @bar } >>> takes_int_array([1, 2, 3]) >> >> because the type match is against the defined type. We do not >> automatically infer that [1, 2,

Re: Sub args: choose one of two?

2015-06-28 Thread Moritz Lenz
Hi, On 06/28/2015 12:39 AM, Tom Browder wrote: > I'm trying to take advantage of the MAIN suroutine to handle most all of > my routine command line arg handling. One idiom I use a lot is for the > user to choose only one of two args, but one must be chosen. So since it's not optional, you might

Re: Problem documentation and/or compiler

2015-06-18 Thread Moritz Lenz
Hi Marcel, On 06/18/2015 11:17 AM, mt1957 wrote: Sorry I've been too fast, It's in the doc. However, why can't I assign it to a Buf with automatic coercion from utf8 to Buf which is more generic? The docs are wrong; it should be Blob, not Buf. I've fixed it in https://github.com/perl6/doc/com

Re: New Logo Design for perl6 modules

2015-06-10 Thread Moritz Lenz
Hi, On 06/10/2015 02:01 PM, Lin Yo-an wrote: Hi folks! I designed a logo for CPAN, and I think it can be used for perl6 modules, don't know if you're interested in it? https://twitter.com/c9s/status/608549774648692736 Great, I like it! Is there a high-res version available? What's the licens

Re: Perl 5's $0 vs. Perl 6's $*EXECUTABLE_NAME

2015-05-30 Thread Moritz Lenz
Hi, On 05/30/2015 04:36 PM, Paul Cochrane wrote: > Thanks for pointing out the $*PROGRAM omission! I've just added it to the > list of special variables and it should be available online within the next > 10-15 minutes. Minor nit pick: according to the last log on http://doc.perl6.org/build-log/

Re: [perl #125211] Error "Function X::Panda needs parens to avoid gobbling block" when running panda on JVM, but not on Moar

2015-05-18 Thread Moritz Lenz
On 05/18/2015 04:07 AM, Rob Hoelz (via RT) wrote: # New Ticket Created by Rob Hoelz # Please include the string: [perl #125211] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=125211 > The full error message: ===SORRY!=== Fu

Re: Can a user "cheat" and call a class's private method?

2015-05-12 Thread Moritz Lenz
Hi, On 05/12/2015 09:40 PM, R. Ransbottom wrote: > On Mon, May 11, 2015 at 03:22:46PM -0700, Darren Duncan wrote: > >> you can use "trusts". Also having to do this may indicate bad code >> design. -- Darren Duncan > > I saw Moritz' and Carl's responses and I agree with the smell > issue. > >

Re: [perl #125153] Pod nesting needs some clarity

2015-05-11 Thread Moritz Lenz
On 05/11/2015 02:47 PM, (via RT) wrote: # New Ticket Created by # Please include the string: [perl #125153] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=125153 > It's not clear which =begin is not terminated here, based on

Re: class/object variables

2015-04-23 Thread Moritz Lenz
On 04/21/2015 10:37 PM, mt1957 wrote: L.s. The following piece of code shows that one must be careful using my or state variables in a class. They have the same behavior as an our variable if I am right. The difference is that 'our'-variables can be accessed from the outside ($A::p), 'my' a

Re: Fancy sub arg handling: ability to expand error message?

2015-03-28 Thread Moritz Lenz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, On 28.03.2015 12:27, Tom Browder wrote: > I like the subroutine arg handling in Perl 6. Is there any simple > way to attach a short error msg in place of or additive to the > default for, say, a missing arg? You can always use multi subs, and

Re: Example module and its use

2015-03-28 Thread Moritz Lenz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 28.03.2015 11:05, Tom Browder wrote: > On Sat, Mar 28, 2015 at 5:01 AM, Tom Browder > wrote: >> On Fri, Mar 27, 2015 at 8:27 PM, Nathan Brown >> wrote: > > Okay, this works: > > use Bar :DEFAULT; > > but this does not: > > use Bar ; > > So i

Re: Can a user "cheat" and call a class's private method?

2015-03-26 Thread Moritz Lenz
Hi, On 26.03.2015 16:55, Tom Browder wrote: > I need to test some private routines, so is there a way to do that? The easiest way to do that is when the class with the private methods trusts the class that calls them. See for example http://doc.perl6.org/type/Metamodel::Trusting http://design.per

Re: How to get indirect access to a class attribute?

2015-03-25 Thread Moritz Lenz
Hi, On 25.03.2015 13:44, Tom Browder wrote: > Given a class like: > > our %attrs = (age=>1,wgt=>2); > class foo { has $.age = rw;} should be 'has $.age is rw'. The "is" indicates a trait (not an assignment). > method a { > for %attrs.kv -> $k, $v { > my $aval = self."

Re: rakudo Test module: expanding tests considered?

2015-03-24 Thread Moritz Lenz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 24.03.2015 13:51, Nicholas Clark wrote: > On Tue, Mar 24, 2015 at 09:44:19AM +0100, Moritz Lenz wrote: > >> I'd suggest developing those test functions in a separate module, >> and after gathering some experience wi

Re: rakudo Test module: expanding tests considered?

2015-03-24 Thread Moritz Lenz
Hi, On 24.03.2015 00:15, Tom Browder wrote: > On Mon, Mar 23, 2015 at 5:53 PM, Elizabeth Mattijsen wrote: >>> On 23 Mar 2015, at 23:50, Tom Browder wrote: >>> Question: Would it be better to submit pull requests for some (or >>> all) for the rakudo Test module or start creating a new Test::* >>

Re: Object Introspection for Existence of Methods: How?

2015-03-23 Thread Moritz Lenz
Hi, On 03/23/2015 01:48 AM, Henk van Oers wrote: On Sun, 22 Mar 2015, Tom Browder wrote: On Sun, Mar 22, 2015 at 7:13 PM, Henk van Oers wrote: On Sun, 22 Mar 2015, Tom Browder wrote: I'm trying to write a test. To test what? Your own typo's? The tests are for a public Perl 6 module trans

Announce: Rakudo Star Release 2015.03

2015-03-21 Thread Moritz Lenz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 ## A useful, usable, "early adopter" distribution of Perl 6 On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the March 2015 release of "Rakudo Star", a useful and usable distribution of Perl 6. The tarball for the March 2015

Re: Need help with: Cannot find method 'postcircumfix:<( )>'...

2015-03-20 Thread Moritz Lenz
On 03/20/2015 11:00 AM, Timo Paulssen wrote: On 03/20/2015 03:40 AM, Brandon Allbery wrote: On Thu, Mar 19, 2015 at 10:33 PM, Tom Browder mailto:tom.brow...@gmail.com>> wrote: Why do you say that is not a method? The first line says Sorry, somehow I managed to misread that. So you wa

Re: Passing arrays to subroutines

2015-03-19 Thread Moritz Lenz
On 03/19/2015 04:05 PM, Tom Browder wrote: In Perl 5 I can do this: my @a = (1, 2); my @b = (3); foo(@a,@b); sub foo { my $n = @_; die "Wrong num args: $n" if ($n != 3);} In Perl 6 I think this is correct (or nearly so): sub foo(*@args) { die "Wrong num args: { @args.elems }" if @args.ele

Re: [perl #124108] [BUG] reduce meta-operator fails with 'max' on list larger than 2**15 with MoarVM

2015-03-19 Thread Moritz Lenz
On 03/19/2015 10:14 AM, Nicholas Clark wrote: On Wed, Mar 18, 2015 at 05:13:54AM -0700, David Hoekman wrote: Thanks for the concise and interesting bug report. There might be a whole bunch more things that break in a similar way... perl6-m -e 'say [max] 1..(1+2**15)' arg flag is empty in sl

Re: Can a class have an attribute and a method with the same name?

2015-03-19 Thread Moritz Lenz
Hi, On 03/19/2015 12:40 AM, Tom Browder wrote: I have a class with an attribute and a method with the same name and it looks so far like they clash. Attributes are always private. If you write 'has $.x', that generates not only the attribute, but also an accessor method of name 'x'. See also

Re: Object Contruction

2015-03-18 Thread Moritz Lenz
Hi On 03/18/2015 01:06 PM, Tom Browder wrote: My new object needs some methods run during construction. How can I do that without defining my own "new" method? http://doc.perl6.org/language/objects#Object_Construction lists at least two possible ways. Probably the most interesting one is BUI

Re: Perl 6 Debugging

2015-03-14 Thread Moritz Lenz
On 15.03.2015 00:05, Tom Browder wrote: > On Sat, Mar 14, 2015 at 5:25 PM, Elizabeth Mattijsen wrote: >>> On 14 Mar 2015, at 23:19, Tom Browder wrote: > ... >> Could you post the code of test_ellipsoid.pl for others to see (e.g. on >> gist.github.com)? That would help in tracing the problem (whi

  1   2   3   4   5   6   7   8   9   10   >