Re: mixin syntax: does vs but

2018-06-12 Thread Brad Gilbert
On Tue, Jun 12, 2018 at 12:55 PM, Joseph Brenner wrote: > Thanks, both your suggestion and JJ Merelo's work, but I think I like > yours for readability: > > # # using binding, suggested by JJ Merelo > # my @y := @x but LookInside; > > # suggested by Elizabeth Mattijsen l...@dijkmat.nl >

Re: need second pair of eyes

2018-06-03 Thread Brad Gilbert
It's -I. not -I On Sun, Jun 3, 2018 at 5:05 PM, ToddAndMargo wrote: > On 06/03/2018 02:54 PM, Brad Gilbert wrote: >> >> You can use q[./] instead of \'./\' >> (especially useful so that it will work on both Windows and Unix >> >> But in this case it is even bett

Re: need second pair of eyes

2018-06-03 Thread Brad Gilbert
You can use q[./] instead of \'./\' (especially useful so that it will work on both Windows and Unix But in this case it is even better to use -I and -M p6 -I. -MRunNoShell -e '( my $a, my $b ) = RunNoShell::RunNoShell("ls *.pm6"); say $a;' On Sun, Jun 3, 2018 at 4:47 PM,

Re: <> question

2018-06-03 Thread Brad Gilbert
On Sun, Jun 3, 2018 at 3:08 PM, ToddAndMargo wrote: > On 06/03/2018 11:01 AM, Brandon Allbery wrote: > >> Is there something missing in the examples at the link? >> > > Well, a bit. When I see > > chmod 0o755, ; > > I think `myfile1` and `myfile2` are "functions", not > data. > They

Re: An operation first awaited

2018-05-28 Thread Brad Gilbert
Comments inline. On Mon, May 28, 2018 at 2:02 AM, Norman Gaywood wrote: > T""his simple program creates a thread to read a directory with dir() and > place the files on a channel. $N worker threads read that channel and > "process" (prints) the files. But I'm getting this "An

Re: my keeper on random numbers

2018-05-26 Thread Brad Gilbert
On Sat, May 26, 2018 at 10:59 PM, ToddAndMargo wrote: > On 05/26/2018 05:10 AM, Brian Duggan wrote: >>> >>> To convert to an positive integer, use truncate: >>> $ p6 'say 1000.rand.truncate;' >>> 876 >> >> >> or use pick: >> >> perl6 -e 'say (^1000).pick' >> 209

Re: any better explanation of look ahead assertions

2018-05-10 Thread Brad Gilbert
On Thu, May 10, 2018 at 9:09 PM, ToddAndMargo <toddandma...@zoho.com> wrote: > On 05/10/2018 07:06 PM, Brad Gilbert wrote: >> >> You could read how they work in PCRE > > > What is PCRE? Perl Compatible Regular Expressions, Basically someone reimplemented the r

Re: any better explanation of look ahead assertions

2018-05-10 Thread Brad Gilbert
On Thu, May 10, 2018 at 8:13 PM, ToddAndMargo wrote: > Hi All, > > Looking at: > https://docs.perl6.org/language/regexes#Lookahead_Assertions > https://docs.perl6.org/language/regexes#Lookbehind_assertions > > I can't tell heads from tails. Does anyone know of a

Re: I need `dir` help

2018-05-10 Thread Brad Gilbert
On Thu, May 10, 2018 at 7:02 PM, ToddAndMargo wrote: > On 05/10/2018 04:56 PM, Brandon Allbery wrote: >> >> I think you'll need to provide a better explanation of what you're trying >> to accomplish. I can think of lots of ways to do useful things with the >> output of

Re: Using HashBags

2018-04-08 Thread Brad Gilbert
You can do the following my %b is BagHash = … or my %b := bag … On Sun, Apr 8, 2018 at 10:54 AM, Vittore Scolari wrote: > I answer myself: with % you get an Hash > > On Sun, Apr 8, 2018 at 5:53 PM, Vittore Scolari > wrote: >> >>

Re: (default) Real->Rat precision should match what compiler uses for literals

2018-03-03 Thread Brad Gilbert
On Fri, Mar 2, 2018 at 4:33 PM, Jim Avera wrote: > Hello, > > Using Rakudo 2018.01: > > my Rat $rat-from-literal = 1.23456789; > my Rat $rat-from-str = "1.23456789".Rat; > my Real $real = 1.23456789e0; > my Rat $rat-from-real= $real.Rat;

Re: Self invoked anonymous functions with no outer scoped ???

2017-12-08 Thread Brad Gilbert
Let's say this keyword throws away everything in the lexical scope, except for what you declare sub compute-G (\a, \b, \c) { my \d = only-use ( a, b, :<+>, :<*>, :<**> ) { a + b * 2 ** 3 } … return g; } I think that would get old real quick. On Fri, Dec

Re: tip: case insensitive test

2017-11-07 Thread Brad Gilbert
The way to add `:i` to regex without using `m` is to include it inside of the regex `/:i abcdef/` On Fri, Nov 3, 2017 at 5:30 PM, ToddAndMargo wrote: > Dear List, > > Okay, I am pretty sure there are no copyrights here. > > I had a problem where I had to read through a

[perl #132283] [REGRESSION] BUILDALL is listed as one of the methods, maybe that's not right (say $foo.^methods)

2017-10-21 Thread Brad Gilbert via RT
On Sat, 21 Oct 2017 08:18:46 -0700, alex.jakime...@gmail.com wrote: > https://irclog.perlgeek.de/perl6-dev/2017-10-21#i_15334639 > > I' think we should test that both are listed, and we can close the > ticket. > I don't think we should force all future implementations to add BUILDALL.

Re: <<>> question

2017-10-05 Thread Brad Gilbert
On Thu, Oct 5, 2017 at 11:44 AM, Andy Bach wrote: > >> is ><<>> >> synonymous with >qw[] > ? `<<>>` is the same as `qqww<<>>` Which is short for `Q :qq :ww <<>>` the `:qq` is short for `:double`, that is it turns on double quote behaviour `:double` is short for

Re: next

2017-06-19 Thread Brad Gilbert
On Mon, Jun 19, 2017 at 11:15 AM, Andy Bach wrote: > > On Fri, Jun 16, 2017 at 11:11 PM, Gabor Szabo wrote: >> >> If the loop has some action and a condition it will jump to execute >> the action again (increment $i) and check the condition and act >>

Re: [perl #131599] [BUG] "my %hash is default([])" misbehaves

2017-06-19 Thread Brad Gilbert
There does appear to be a bug, but I'd argue that it is in your code. my %sum{Int} is default([]); That line of code sets the default for all elements when they are first accessed to the very same instance of an Array. Remove the `is default([])` To stop the warnings that would then happen

Re: [perl #131599] [BUG] "my %hash is default([])" misbehaves

2017-06-19 Thread Brad Gilbert via RT
There does appear to be a bug, but I'd argue that it is in your code. my %sum{Int} is default([]); That line of code sets the default for all elements when they are first accessed to the very same instance of an Array. Remove the `is default([])` To stop the warnings that would then happen

Re: How do you call the variable types?

2017-06-09 Thread Brad Gilbert
@ does the Positional role % does Associative & does Callable $ causes its value to be an item (its values do not flatten into an outer list when you use `flat`) my %hash is SetHash; Array does Positional, and all of its values are itemized We are unlikely to call $ variables "generic"

Re: need help with "next"

2017-05-23 Thread Brad Gilbert
You do realize that `next` immediately stops the current iteration and goes onto the *next* one right? That is, there is no point putting any code after it because it will never be run. On Tue, May 23, 2017 at 11:30 PM, ToddAndMargo wrote: > Hi All, > > I have a test code

[perl #131290] is default() doesn't work on attributes

2017-05-12 Thread Brad Gilbert via RT
On Fri, 12 May 2017 03:04:46 -0700, elizabeth wrote: > m: class A { has Int $.a is default(42) }; dd A.new.a > # expected to see 42 there, not Int, so feels like "is default" on > attrs isn't implemented? It does work if you add =Nil class A { has Int $.a is rw is default(42) = Nil

Re: Module take-over policy

2017-03-28 Thread Brad Gilbert
Responses inline On Tue, Mar 28, 2017 at 10:37 PM, Richard Hainsworth wrote: > I've seen a couple of references to modules that no longer work; it's > inevitable with a new language. > > There is a balance between having respect for / protecting the original > developer,

Re: Can this OR be shortened?

2017-03-24 Thread Brad Gilbert
On Fri, Mar 24, 2017 at 8:16 PM, Darren Duncan wrote: > Just speculating, but try replacing the "||" with the "|" operator which > should create an ANY Junction, if I'm not mistaken, which may then do what > you want. -- Darren Duncan > All of these should work if

Re: Help mechanism in REPL?

2016-09-10 Thread Brad Gilbert
There was some talk in the past about having `.WHY` look up the descriptions in the POD6 doc ( so that we don't have to bloat Rakudo with that information ) On Fri, Sep 9, 2016 at 6:30 PM, Alex Elsayed wrote: > On Wednesday, 7 September 2016 17:57:32 PDT Parrot Raiser

[perl #53924] [PATCH] t/op/sysinfo.t typos

2008-05-09 Thread Brad Gilbert
# New Ticket Created by Brad Gilbert # Please include the string: [perl #53924] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=53924 Fixed some typos in t/op/sysinfo.t Index: t/op/sysinfo.t

[perl #53362] [NEW] Add a test for the sysinfo op.

2008-04-25 Thread Brad Gilbert
# New Ticket Created by Brad Gilbert # Please include the string: [perl #53362] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=53362 I added a test for the sysinfo op. The main reason I decided to work on it is so

<    1   2   3