Re: Is there a backward "for @"

2018-05-15 Thread Brock Wilcox
Slightly more idiomatic might be `next unless $line`. On Tue, May 15, 2018 at 7:39 PM ToddAndMargo wrote: > On 05/15/2018 04:34 PM, ToddAndMargo wrote: > > On 05/15/2018 03:49 PM, Larry Wall wrote: > >> On Tue, May 15, 2018 at 03:31:07PM -0700, ToddAndMargo wrote: > >> : Hi All, > >> : > >> : Th

Re: Any way to get hashes to loop in order?

2017-09-30 Thread Brock Wilcox
Maybe a list/array of pairs would be better, and then cast it to a hash if you need to do fast lookups. On Sep 30, 2017 12:41 PM, "Parrot Raiser" <1parr...@gmail.com> wrote: > Prepending the real key value with an order indicator, then sorting > the retrieved list on the key would achieve that, (

Re: Running external CLI tool and capturing output

2017-08-10 Thread Brock Wilcox
How about qx and qxx? I guess those don't separate/capture stderr, and don't separate out the params. --Brock On Thu, Aug 10, 2017 at 10:57 AM, Gabor Szabo wrote: > The documentation has a nice example showing how to run an external > program and how to get its output or even its standard erro

Re: User defined infix operators and whitespace

2017-08-10 Thread Brock Wilcox
I think there are a couple answers. The simple one is yes -- embrace the whitespace. Maybe wrap them in ()', like (2 d 6). Another line of ideas is wrapping things with some other operators. Maybe a special quoting operator or a converter. [[2d6]] # double for dice! "2d6":dice # postfix. This

Re: Perl6 shell, Was: command auto-completion in perl6 shell

2017-05-31 Thread Brock Wilcox
Some progress on this has already been made, which is how it got as close to standalone as it is now -- previously the REPL was more NQP than Rakudo. Do you have something specific in mind? One of my dreams is to adopt a client/server + middleware model from nREPL (clojure) which I think works rea

Re: Perl 5 list assignment idiom

2017-03-13 Thread Brock Wilcox
The == operator coerces to Numeric, so like: > sub one-thing { return ("hi",) } sub one-thing () { #`(Sub|93867233982256) ... } > one-thing.Numeric 1 (mentioned in https://docs.perl6.org/routine/$EQUALS_SIGN$EQUALS_SIGN) I think my does indeed do some fancy precidenting with the assignment. --B

Re: Need Inline::Perl5 help

2017-03-05 Thread Brock Wilcox
Looks like Term::ANSIColor does weird things with exported constants -- they are some sort of constant-function rather than simple strings. Here is an alternate usage that does what you want: #!/usr/bin/perl6 use Inline::Perl5; use Term::ANSIColor:from ; my $Red = color('red'); my $Reset = colo

Re: per 5 converter?

2017-02-12 Thread Brock Wilcox
Also http://perldoc.perl.org/perlsub.html#Signatures for perl5 signatures. Use it everywhere! Promote it to be on by default! Go team! On Sun, Feb 12, 2017 at 8:12 PM, Darren Duncan wrote: > On 2017-02-12 5:08 PM, ToddAndMargo wrote: > >> I presume my eyes would tell where I made the boo-boo. L

Re: Startup performance on OS X

2016-10-03 Thread Brock Wilcox
It seems like Moose vs built-in-oop/mop is a very indirect comparison. Now I'm wondering what nqp or moarvm startups are like. On Oct 3, 2016 06:14, "Elizabeth Mattijsen" wrote: > > On 02 Oct 2016, at 11:00, Thor Michael Støre > wrote: > > > > Hey everyone! > > > > Is this normal startup perfor

Re: Learn Perl 6

2016-09-28 Thread Brock Wilcox
Good feedback. I just did a similar search in a fresh (incognito) browser with similar, though not quite as bad, results. All the top things at least are active and have links to good stuff. I don't know what "SixFix" is, but I signed up :) On Wed, Sep 28, 2016 at 8:56 PM, Sayth Renshaw wrote:

Re: Observations from a C++/Python developer that never used Perl5

2016-09-09 Thread Brock Wilcox
Quotes are almost a circumfix operator, but they act a bit more like a macro by controlling the parsing of the contents. But you can do some weird things like define your own quote-likes. perl6 -e ' sub circumfix:<>($v) { "{$v}" } ; say B"foo"B ' # output: foo or more verbosely perl6 -e ' sub ci

Re: can Perl 6 bootstrap itself

2016-08-25 Thread Brock Wilcox
Simplification of Rakudo's build process is an ongoing process, and I see progress all the time. Remember also that Rakudo is the most active and complete implementation of Perl 6, but that there can and should be other completely separate implementations. On Aug 25, 2016 1:37 PM, "Dipesh Sharma"

Re: Killer Features of Perl 6

2016-08-22 Thread Brock Wilcox
Correct -- there are some excellent REPLs for perl5 such as Devel::REPL and tinyrepl. The advantage for Perl 6 will be (but is not yet) it's multi-threaded friendliness. I am slowly working on the tools to build something like clojure's nREPL -- a client/server repl where your console, editor, and

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

2016-05-01 Thread Brock Wilcox
Right - use parenthesis in colon-pair parameters to get the variable inside. You could use :database<<$db>> to make it like a double-quoted string. Or my favorite is to use regular => as in database => $db --Brock On May 1, 2016 09:13, "Mathieu Gagnonn" wrote: Hello James, You can try :databas

Re: Where do I need to put a pm6 file?

2016-05-01 Thread Brock Wilcox
I recommend putting your module into a 'lib' dir near your script. Then in your script add: use lib 'lib'; That way you don't have to add the -l param. On May 1, 2016 09:21, "Fernando Santagata" wrote: > Hello, > > I'm trying to write a module and make a program load and use it. > Since this

Re: can a method name contain a funny character?

2016-04-12 Thread Brock Wilcox
Heart doesn't work for me, but other symbols seem fine. I don't know why. I also didn't need to quote them. Here is a REPL session from a Rakudo 2016.01.1: > sub Δ($x) { say "got $x" } sub Δ ($x) { #`(Sub|106407520) ... } > Δ(23) got 23 > class Foo { method Δ($x) { say "method got $x" } } > Foo.ne

Re: can a method name contain a funny character?

2016-04-10 Thread Brock Wilcox
Maybe try it without the term, just "method funnychar (..." On Apr 10, 2016 09:23, "Theo van den Heuvel" wrote: > Hi perl6 fans, > > I can use funny characters in operators or in sub names (using > term:<...>). However, when I try the same thing with an operator as in: > > > class Foo { > meth

Re: books on p6?

2016-03-10 Thread Brock Wilcox
Yes, that is out of date. I don't know of any existing books or public efforts to write ones. We welcome contributions to docs.perl6.org, including tutorials, walk-throughs, etc (beyond just references). That resource is getting better, but slowly :) --Brock On Thu, Mar 10, 2016 at 3:59 AM, Luc

Re: Confused about rakudobrew and Rakudo Star

2016-02-08 Thread Brock Wilcox
What I mean is that if rakudo 2016.02, 2016.03, etc are released, I can still do rakudobrew build moar 2016.01.1 to get the rakudo that is bundled in the Rakudo Star 2016.01 release. --Brock On Mon, Feb 8, 2016 at 3:01 AM, Moritz Lenz wrote: > On 02/06/2016 12:37 AM, Brock Wilcox wr

Re: Confused about rakudobrew and Rakudo Star

2016-02-05 Thread Brock Wilcox
Thu, Feb 4, 2016 at 7:44 AM, Brock Wilcox > > > wrote: > >> > >> I see Moritz replied to this also saying that the tarball is the way to > >> go. I'd love to know what I'm missing out on by doing it this way. > > > > > > Probably nothin

Re: Confused about rakudobrew and Rakudo Star

2016-02-04 Thread Brock Wilcox
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 panda # Build panda for this rakudo pa

Re: Needed: Rakudo Star with 6.c Christmas Perl 6 release

2016-01-16 Thread Brock Wilcox
I think folks were shooting for sometime-this-month. On Jan 16, 2016 1:40 PM, "James E Keenan" wrote: > Today, I posted on the ny.pm mailing list an announcement that I will > attempt to organize a Perl 6 Beginners study group in New York City. > > I have been advised that for an introductory-lev

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

Re: release?

2015-12-28 Thread Brock Wilcox
Rakudo, as far as I know, passes all of the 6.c tests :). But that might mean that we need more tests! On Dec 28, 2015 04:37, "Amir E. Aharoni" wrote: > My understanding is that the happy and long-awaited release announcement > was done on Christmas out of tradition of announcing Perl releases on

Re: Perl 6.c!!

2015-12-27 Thread Brock Wilcox
No substantial rumors that I've heard. I've been contributing to doc.perl6.org, maybe we can get that good enough to bind :) On Dec 27, 2015 05:35, "Tom Browder" wrote: > Thank you Perl 6 devs--what a great Christmas present! > > Now I'm looking forward to buying my first paper copy of a Perl 6.c

Re: Constants as members of a class

2015-12-17 Thread Brock Wilcox
Two things jump out at me. One is that I think you don't need that "new" method. Second -- yes, this is a very old interpreter. I unfortunately don't know about the twigil variable constant things. --Brock On Thu, Dec 17, 2015 at 9:46 PM, TS xx wrote: > Hello dear perl6 users, > > I was in the