Re: how do I assign an array to a hash key

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 12:44 AM, ToddAndMargo wrote: > I will probably use the @ for a while until I get use to > it for readability. > I think that's actually disrecommended, because it looks too much like Perl 5's refs but isn't, so it can bite you unexpectedly if you

Re: -f ???

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 12:41 AM, ToddAndMargo wrote: > Does perl 6 have an equivalent to bash's "-f" to > see if a file exists? Or is that a system call? > IO::Path's .f method. (Or .e to not require it to be a file, etc. as usual.) pyanfar Z$ 6

Re: -f ???

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 1:06 AM, Brandon Allbery <allber...@gmail.com> wrote: > On Fri, Sep 29, 2017 at 12:59 AM, ToddAndMargo <toddandma...@zoho.com> > wrote: > >> On 09/28/2017 09:53 PM, ToddAndMargo wrote: >> >>> On 09/28/2017 09:45 PM, Brandon Al

Re: -f ???

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 12:59 AM, ToddAndMargo <toddandma...@zoho.com> wrote: > On 09/28/2017 09:53 PM, ToddAndMargo wrote: > >> On 09/28/2017 09:45 PM, Brandon Allbery wrote: >> >>> IO::Path's .f method. (Or .e to not require it to be a file, etc. as >

Re: -f ???

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 1:10 AM, Brandon Allbery <allber...@gmail.com> wrote: > Apparently not a bug, just unfortunate. You have to explicitly coerce it > to Bool to keep it from throwing. > > pyanfar Z$ 6 '".profileX".IO.f.Bool.say' > False > This ca

Re: Tip: assign a value to a hash using a variable as a key

2017-09-30 Thread Brandon Allbery
On Sat, Sep 30, 2017 at 7:44 PM, ToddAndMargo <toddandma...@zoho.com> wrote: > On 09/30/2017 02:15 PM, Brandon Allbery wrote: > >> This concept gets reused enough that it's not separately described for >> every place where it is used; the documentation would be impossi

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

2017-09-29 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 9:55 PM, ToddAndMargo wrote: > for %SmtpIni.kv -> $key, $value { say $key; } > > Does "say" the keys in the order that I created them. > > Is there a way to get them to do so? > Not without storing that order somewhere yourself and using it to

Re: [perl #132185] [LTA] file tests and Failure do not interact as expected

2017-09-30 Thread Brandon Allbery
On Sat, Sep 30, 2017 at 4:35 PM, Sam S. via RT wrote: > To the extent that you're basing your expectations on the fact that a Perl > 5 `undef` can be used in ways that a Perl 6 `Failure` cannot (without > blowing up), well, that's just a matter of having to unlearn

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

2017-09-30 Thread Brandon Allbery
On Sat, Sep 30, 2017 at 5:00 PM, ToddAndMargo <toddandma...@zoho.com> wrote: > On 09/29/2017 07:25 PM, Brandon Allbery wrote: > >> The point of a hash is that it computes hash values from its keys for >> fast lookup, >> > > Not me. I use them to "organize

Re: Tip: assign a value to a hash using a variable as a key

2017-09-30 Thread Brandon Allbery
On Sat, Sep 30, 2017 at 5:08 PM, ToddAndMargo wrote: > On 09/30/2017 02:20 AM, Timo Paulssen wrote: > >> This doc page should help you a lot with this topic: >> >> https://docs.perl6.org/language/subscripts#Basics >> >> > A little bit. I had found that when I was

Re: Tip: assign a value to a hash using a variable as a key

2017-09-30 Thread Brandon Allbery
On Sat, Sep 30, 2017 at 10:30 PM, ToddAndMargo <toddandma...@zoho.com> wrote: > On 09/30/2017 02:15 PM, Brandon Allbery wrote: > >> Basically: < > is single quotes and treats variables and expressions as >> literals. << >> is double quotes and interpolate

Re: Tip: assign a value to a hash using a variable as a key

2017-10-01 Thread Brandon Allbery
On Sun, Oct 1, 2017 at 4:01 AM, ToddAndMargo <toddandma...@zoho.com> wrote: > On 09/30/2017 07:59 PM, Brandon Allbery wrote: > >> Inside " " strings, variables like $foo and (simple) expressions >> (described above) will be replaced by their values; and you c

Re: Tip: assign a value to a hash using a variable as a key

2017-10-01 Thread Brandon Allbery
On Sun, Oct 1, 2017 at 4:01 AM, ToddAndMargo <toddandma...@zoho.com> wrote: > On 09/30/2017 07:59 PM, Brandon Allbery wrote: > >> parenthesized expression (so, "hi $foo.name <http://foo.name>" will not >> work (it'll expand '$foo' instead of '$foo.name

Re: Perl 6 Object Construction - General Advice

2017-10-01 Thread Brandon Allbery
On Sun, Oct 1, 2017 at 1:02 PM, yary wrote: > > I hadn't heard of TWEAK, thought that BUILD was for setting private > attributes and other tasks the object runs to build itself. > IIRC having BUILD overrides default values, so if you want to have those and still adjust things

Re: [perl #132194] $*PROGRAM-NAME is not assignable / does not change process's name

2017-10-01 Thread Brandon Allbery
On Sun, Oct 1, 2017 at 12:35 PM, Zoffix Znet wrote: > $*PROGRAM-NAME is supposed to be a replacement for Perl 5's $0, but it > doesn't work that way. > > What I'd expect to work: > > use v6; > $*PROGRAM-NAME = 'foo'; > This is not portable and not reliable ---

Re: Tip: assign a value to a hash using a variable as a key

2017-10-01 Thread Brandon Allbery
On Sun, Oct 1, 2017 at 4:32 AM, Richard Hainsworth wrote: > > >> Is English your first Language? I asked this because of your use >>> >> of the word "interpolate", which you used correctly. >> > This is an odd question and comes across as prejudiced. If someone uses a >

Re: Perl 6 Object Construction - General Advice

2017-10-01 Thread Brandon Allbery
On Sun, Oct 1, 2017 at 4:56 PM, Timo Paulssen wrote: > *method new* is useful only if you want to take positional parameters for > the .new — the default new you get from *Mu* only accepts named arguments > and passes them on as-is to *self.bless*. They then get passed to every

Re: Need append help

2017-09-29 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 2:32 PM, Sean McAfee <eef...@gmail.com> wrote: > On Fri, Sep 29, 2017 at 11:27 AM, Brandon Allbery <allber...@gmail.com> > wrote: > >> On Fri, Sep 29, 2017 at 2:04 PM, ToddAndMargo <toddandma...@zoho.com> >> wrote: >> >>&

Re: Need append help

2017-09-29 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 1:49 PM, ToddAndMargo wrote: > I am trying to find a shorter way of doing > $x = $x ~ "def" > > But I can't seem to master "append" > > What am I doing wrong? > Again (as with last night in IRC) you are treating a string as a list. But a

Re: -f ???

2017-09-29 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 9:53 AM, Parrot Raiser <1parr...@gmail.com> wrote: > Discussing the full implications of these tests could probably keep a > philosophy class busy for an afternnon. It might even rise to an > LPU[1] paper. > It's even more involved than you think; I have notes for what

Re: Need append help

2017-09-29 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 2:04 PM, ToddAndMargo wrote: > $ perl6 -e 'my $x="abc"; $x ~= "def"; say $x;' > abcdef > > Perfect! Thank you! > > I am slowly getting away from my Modula 2 "Array of Characters" days. > > Question: Is thee a pretty way like the above to do a

Re: Need append help

2017-09-29 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 3:27 PM, ToddAndMargo wrote: > I do not understand. :'( > There's not enough syntax to go around, so perl 6 has to use spaces sometimes to figure out what you want. > $ perl6 -e 'my $x="abc"; $x[R~]= "yyz"; say $x;' > ===SORRY!=== Error while

Re: Need append help

2017-09-29 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 3:36 PM, ToddAndMargo wrote: > This is the correct one. The warning about "useless use" here is a bug >> in rakudo. It's meant to warn for things like >> > Another bug. Lucky me, again. :'( > > Thank you! > Also, this is about the third time in

Re: Need append help

2017-09-29 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 2:59 PM, ToddAndMargo wrote: > $ perl6 -e 'my $x="abc"; $x [R~]= "yyz"; say $x;' > ===SORRY!=== Error while compiling -e > Missing required term after infix > at -e:1 > --> my $x="abc"; $x[R~⏏]= "yyz"; say $x; > expecting any of: >

Re: chown?

2017-09-28 Thread Brandon Allbery
On Thu, Sep 28, 2017 at 11:15 PM, ToddAndMargo wrote: > I wonder why they did not "banish" (sound so harsh) chmod? > Basic file permissions are actually relatively similar. Windows (and OS X! see chmod(1)) integrate ACL support, but there's still a reasonably common core

Re: Hash and subs question

2017-09-28 Thread Brandon Allbery
On Thu, Sep 28, 2017 at 11:52 PM, ToddAndMargo wrote: > I see that SayHash(%H) will take any hash I send it. > > Is there a way to make the compiler pissed if a sub does not see > the specific keys int he hash it wants? Or do I need to use loop > with ":exists" and test

Re: chown?

2017-09-28 Thread Brandon Allbery
On Thu, Sep 28, 2017 at 11:03 PM, ToddAndMargo wrote: > https://docs.perl6.org/language/5to6-perlfunc#chown > > say we ain't got a "chown" sub. > > Will this be coming to a theater neat us in the future? > (I will use a system call till then.) > It's another of those

Re: overwrite?

2017-09-24 Thread Brandon Allbery
On Mon, Sep 25, 2017 at 1:41 AM, ToddAndMargo wrote: > I suppose I should say at this point that the purpose of the file > is to be a single line with the date the program was last run > in it. If the current date's month and the month in the file > differ, it triggers an

Re: [perl #131965] Shaped arrays can't have zero size

2017-08-26 Thread Brandon Allbery
How exactly do you index such an array? On Sat, Aug 26, 2017 at 8:11 PM, Aleks-Daniel Jakimenko-Aleksejev via RT < perl6-bugs-follo...@perl.org> wrote: > Indeed. The limit was introduced as a response to this ticket: > https://rt.perl.org/Ticket/Display.html?id=126800 > The check is probably too

Re: [perl #131965] Shaped arrays can't have zero size

2017-08-26 Thread Brandon Allbery
> Well, what do you mean? Of course you can't put anything into it, and any > attempt to index it will throw. It may seem useless, however, if you can > have > an empty array, why can't you have a shaped empty array? > Only if all dimensions are unindexable. Otherwise you have something with

Re: thread behavior

2017-09-04 Thread Brandon Allbery
On Mon, Sep 4, 2017 at 6:18 AM, Elizabeth Mattijsen wrote: > That can not be relied on in general, I’m afraid. However, after some > discussion, it appears that there is some support for an > "is-initial-thread” method: > >

Re: [perl #132268] Floating point anomalies

2017-10-12 Thread Brandon Allbery
On Thu, Oct 12, 2017 at 5:31 AM, wrote: > Perl6's printf() function looks a little suspect - though I might be > missing > something here. > > As with perl5's say function, doubles are rounded to 14 decimal digits of > precision, so we get: > > $ perl6 -e 'say

Re: who own my code?

2017-10-23 Thread Brandon Allbery
On Mon, Oct 23, 2017 at 1:47 AM, Jan Ingvoldstad <frett...@gmail.com> wrote: > On Sun, Oct 22, 2017 at 10:32 PM, Brandon Allbery <allber...@gmail.com> > wrote: > > This is still best discussed elsewhere... isn't there a stackexchange for > > this kind of stuff? >

Re: Set difference using hashes vs array

2017-11-23 Thread Brandon Allbery
On Thu, Nov 23, 2017 at 9:06 PM, ToddAndMargo wrote: > On 11/22/2017 08:41 PM, Norman Gaywood wrote: > >> my Set $take1 = (%all (-) %remove) (-) %excludes; >> > > What does "Set" do in the above? > Declares a type, which helps avoid errors. Similarly `my Int $a` means $a

Re: p6 for w32

2017-11-30 Thread Brandon Allbery
My vague recollection is that building currently takes more memory than is available in a 32 bit Windows usermode process. On Thu, Nov 30, 2017 at 12:09 AM, Todd Chester wrote: > Hi All, > > Anyone know of a better download site for Perl 6 for > Windows 7, SP1, 32 bit

Re: Anyone want me eMail and download interface for curl?

2017-11-04 Thread Brandon Allbery
On Fri, Nov 3, 2017 at 5:41 PM, ToddAndMargo wrote: > I frequently post modules I have come up with. Should > I stop the practice? > In countries signatory to the Berne Convention on Copyright, the default copyright is problematic; you should be explicit about the

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

2017-12-08 Thread Brandon Allbery
That might prove difficult considering how much of the language is *defined* in outer scopes. (Including, er, the basic grammar.) On Fri, Dec 8, 2017 at 3:25 PM, Andy Bach wrote: > I ran into this article > https://medium.com/@kasperpeulen/an-interesting- >

Re: who own my code?

2017-10-21 Thread Brandon Allbery
On Sat, Oct 21, 2017 at 5:56 AM, ToddAndMargo wrote: > On Sat, Oct 21, 2017 at 12:57 AM, ToddAndMargo >> > wrote: >>> On 10/21/2017 12:40 AM, ToddAndMargo wrote: >>> >>> If I write a program for a customer

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

2017-10-21 Thread Brandon Allbery
On Sat, Oct 21, 2017 at 12:12 PM, Brad Gilbert via RT < perl6-bugs-follo...@perl.org> wrote: > 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

Re: I need `dir` help

2018-05-10 Thread Brandon Allbery
On Thu, May 10, 2018 at 7:34 PM, ToddAndMargo wrote: > https://docs.perl6.org/routine/dir > > perl6 -e 'my $x=dir; say "$x";' > > Does indeed read the directory, but give me one YUGE string. > I need each entry to have some kind of a separator. > I'd say you did that to

Re: I need `dir` help

2018-05-10 Thread Brandon Allbery
On Thu, May 10, 2018 at 7:49 PM, ToddAndMargo <toddandma...@zoho.com> wrote: > On 05/10/2018 04:43 PM, Brandon Allbery wrote: > >> On Thu, May 10, 2018 at 7:34 PM, ToddAndMargo <toddandma...@zoho.com >> <mailto:toddandma...@zoho.com>> wrote: >> It w

Re: I need `dir` help

2018-05-10 Thread Brandon Allbery
5/10/2018 04:49 PM, ToddAndMargo wrote: > >> On 05/10/2018 04:43 PM, Brandon Allbery wrote: >> >>> On Thu, May 10, 2018 at 7:34 PM, ToddAndMargo <toddandma...@zoho.com >>> <mailto:toddandma...@zoho.com>> wrote: >>> >>> htt

Re: I need indir help

2018-05-10 Thread Brandon Allbery
Testing whether a file exists is smartmatching an IO::Path (or a Str that gets coerced to one) against :e. "indir" is not "is this file in this directory?", it's "run this code in this directory instead of where I am now". So it's complaining that you didn't tell it what code to run there. On

Re: I need regex help

2018-05-10 Thread Brandon Allbery
Pretty much what it's telling you. Instead of the numbers in braces, it's the ** operator with a range after it: \d ** 1..4 (Remember that spaces do nothing in a P6 regex, so you can use them for readability or to separate the range from what follows, etc.) On Thu, May 10, 2018 at 11:56 PM,

Re: Need match character help

2018-05-16 Thread Brandon Allbery
You need to be more careful with regexes (any regexes). Your character class matches if any character in the string matches, so 'd' satisfies it and the rest of the string is ignored. If you want to ensure *no* character matches, then say so: pyanfar Z$ 6 'if "dgm" ~~ /^<[d..z]-[gm]>*$/ {say "y"}

Re: need sort help

2018-06-09 Thread Brandon Allbery
More precisely, at that point you have a bunch of numbers, but possibly not as many as expected if some of the components weren't numeric (or all of them, as when there are files present that aren't the expected logs). Which means some or all of those variables will be undefined instead of

Re: need sort help

2018-06-09 Thread Brandon Allbery
nd @x .= sort: { > ... }; ? Is sort an invocant? Or I miss something. > > Regards > > Xin > > > > On Jun 9, 2018, at 12:44 PM, Brandon Allbery wrote: > > More precisely, at that point you have a bunch of numbers, but possibly > not as many as expected if some of

Re: need sort help

2018-06-09 Thread Brandon Allbery
a <=> $^b}) On Sat, Jun 9, 2018 at 4:05 PM Brandon Allbery wrote: > The colon only works on a method call. In "say sort:" it's not used as a > method, it's used as a sub; the colon causes it to try to reinterpret as a > method call, then it can't find an invoca

Re: need sort help

2018-06-09 Thread Brandon Allbery
lon here mean, although I know it works. > > If I write something like this, > > p6 'say sort: {$^a <=> $^b} < 3 5 2 1> ' # It doesn't work. > > But why? Why the colon works in one form, but not in another form? So I > want to know the meaning of the colon when it work

Re: need second pair of eyes

2018-06-12 Thread Brandon Allbery
I don't expect if $Line ~~ | "wine-patched/archive/staging-/" && ".tar.gz " | does what you expect. In fact, I'm not sure what you expect there; those |-s are going to be taken as slip prefix operators, and the second one indeed will gobble the following block as the expression it

Re: need second pair of eyes

2018-06-12 Thread Brandon Allbery
No, you are stuck with $foo ~~ m|xxx| && $foo ~~ m|yyy| or $foo ~~ m|xxx .* yyy| (the latter assuming they always happen in that order; if they don't, you can only use the first.) On Tue, Jun 12, 2018 at 8:25 PM ToddAndMargo wrote: > On 06/12/2018 05:19 PM, Brandon Al

Re: need second pair of eyes

2018-06-12 Thread Brandon Allbery
e:1 > > > --> ging-/" && ".tar.gz " | {say "yes"}⏏ else {say "no}; > > > > > > > > > :'( > > > > > > -T > > > > > > This fixed

Re: need second pair of eyes

2018-06-12 Thread Brandon Allbery
Same as in perl 5: m ... m|xxx| On Tue, Jun 12, 2018 at 7:35 PM ToddAndMargo wrote: > On 06/12/2018 03:41 PM, ToddAndMargo wrote: > > Hi Alk, > > > > What am I dong wrong here? > > > > > > $ p6 'my $Line = "wine-patched/archive/staging-/x.tar.gz"; if $Line > > ~~ |

Re: mixin syntax: does vs but

2018-06-12 Thread Brandon Allbery
.WHAT is a "macro"/shorthand, which is why it's uppercase. There's a metamodel (the real meaning of the ^) version of it as well. On Tue, Jun 12, 2018 at 2:59 PM Joseph Brenner wrote: > >> say @y.^WHAT > > > If you want to print the name use `.^name`. > > > If you want the type object for more

Re: stackoverflow vs the world (and perl6-users)

2018-06-12 Thread Brandon Allbery
I replied to this one in private, but I want to make a point in public as well. On Tue, Jun 12, 2018 at 4:24 PM Brad Gilbert wrote: > The barrier is not with Stack Overflow. (←What I obviously meant) > The barrier is within you. > There's an insidious assumption hidden in here: that "the

Re: stackoverflow vs the world (and perl6-users)

2018-06-12 Thread Brandon Allbery
I'm going to stay out of this one, except to the point that my problem with stackoverflow is none of these. It's more fundamental than that. And it's not something that can be "fixed" on my side. (Suffice it that there might be a Nobel Prize in medicine for someone who figures out how to do that.)

Re: mixin syntax: does vs but

2018-06-12 Thread Brandon Allbery
bootstrapping issue with getting at the metamodel, you need to have it first. Which is why it's wired into the compiler and gets those uppercase pseudo-method names. On Tue, Jun 12, 2018 at 3:00 PM Brandon Allbery wrote: > .WHAT is a "macro"/shorthand, which is why it's uppercase. There'

Re: stackoverflow vs the world (and perl6-users)

2018-06-12 Thread Brandon Allbery
On Tue, Jun 12, 2018 at 3:38 PM Brad Gilbert wrote: > > The barrier is non-existent. > > I have only ever heard about speculated and imagined barriers. > This is not proof that such barriers don't exist. I hit the magic 2 mark and lasted less than a week afterward because the rules suddenly

Re: How do I remove leading zeros?

2018-06-13 Thread Brandon Allbery
https://docs.perl6.org/language/unicode_entry I have right Alt set as my Compose key, so it'd be [right-Alt] < < (At some point I should see if I can put in some information about WinCompose, since I think I'm currently the only one with any experience with it.) On Wed, Jun 13, 2018 at 2:09 PM

Re: How do I remove leading zeros?

2018-06-13 Thread Brandon Allbery
https://docs.perl6.org/language/regexes#Capture_markers:_%3C(_)%3E On Wed, Jun 13, 2018 at 3:10 PM Xin Cheng wrote: > Now we know the meaning of >> and <<. But what about <( and )> ? What do > they mean here? > > Thanks. > Xin > > On Jun 13, 2018, at 2:18 PM, Brad Gilbert wrote: > > On Wed,

Re: EVAL?

2018-06-13 Thread Brandon Allbery
Exactly what it says: eval is a code injection attack waiting to happen. If you actually need it, you get to do your own data sanitization, and you tell Perl 6 you did so with "use MONKEY-SEE-NO-EVAL;". On Wed, Jun 13, 2018 at 3:22 PM ToddAndMargo wrote: > Hi All, > > I am converting a program

Re: EVAL?

2018-06-14 Thread Brandon Allbery
ot; is one of them. (This is why modules are generally mixed-case names.) https://docs.perl6.org/language/pragmas for more information. On Thu, Jun 14, 2018 at 1:22 PM ToddAndMargo wrote: > On 06/13/2018 12:27 PM, Brandon Allbery wrote: > > Exactly what it says: eval is a code injection a

Re: RFE: eval documentation

2018-06-14 Thread Brandon Allbery
I think the message is obscure for a reason: the last thing you want is for someone to make an insecure module look "safe" by just dropping that pragma into it. You want to make them think about what they are doing. On Thu, Jun 14, 2018 at 1:32 PM ToddAndMargo wrote: > Dear Perl6 Developers, >

Re: EVAL?

2018-06-14 Thread Brandon Allbery
Not to mention "language designer isn't from your culture, and the word has different connotations in theirs". The eastern (or for that matter western) US does not define the world. On Thu, Jun 14, 2018 at 1:57 PM Brandon Allbery wrote: > You can never be certain in *any* case. Ch

Re: EVAL?

2018-06-14 Thread Brandon Allbery
14, 2018 at 1:37 PM ToddAndMargo wrote: > On 06/14/2018 10:30 AM, Brandon Allbery wrote: > > In short, pragmas are all-same-case "use" names; instead of loading > > code, they tell the compiler to change its behavior. > > > > The MONKEY-* pragmas generally control var

Re: EVAL?

2018-06-14 Thread Brandon Allbery
That's actually the origin of it: pragmatic / real-world behavior, as opposed to idealized situations. On Thu, Jun 14, 2018 at 1:47 PM ToddAndMargo wrote: > On 06/14/2018 10:43 AM, The Sidhekin wrote: > > > >More relevant, Perl 6 documentation: > > https://docs.perl6.org/language/pragmas >

Re: EVAL?

2018-06-14 Thread Brandon Allbery
in this sense, since at least the 1960s and probably earlier. So also check various CS glossaries. Such as FOLDOC: http://foldoc.org/pragma On Thu, Jun 14, 2018 at 1:52 PM ToddAndMargo wrote: > On 06/14/2018 10:49 AM, Brandon Allbery wrote: > > That's actually the origin of it: pr

Re: EVAL?

2018-06-14 Thread Brandon Allbery
I'm trying to not second-guess whoever maintains the glossary. And by that message also pointing up the omission. On Thu, Jun 14, 2018 at 2:01 PM The Sidhekin wrote: > On Thu, Jun 14, 2018 at 7:57 PM, Brandon Allbery > wrote: > >> You can never be certain in *any* case.

Re: Malformed UTF-8?

2018-06-16 Thread Brandon Allbery
Something's wrong with the data file you are reading. Perl 6 is expecting UTF-8 encoding and getting something else (usually an ISO-8859 encoding). On Sat, Jun 16, 2018 at 1:09 AM ToddAndMargo wrote: > rakudo-pkg-Fedora28-2018.05-01.x86_64.rpm > $ perl6 -v > This is Rakudo version 2018.05 built

Re: IO ???

2018-06-16 Thread Brandon Allbery
oes this and IO.d >does that. >Any such list exist? >Many thanks, >-T > > > On 06/03/2018 10:03 AM, Brandon Allbery wrote: > > It's a bit subtle to track down, but the IO method gives you an IO::Path > object. https://docs.perl6.org/

Re: need sort help

2018-06-08 Thread Brandon Allbery
y $a = $^a ~~ > m:g/\d+/;my > >> $b = $^b ~~ m:g/\d+/;$a[6].defined cmp $b[6].defined ?? $a[3] cmp > $b[3] > >> || $a[1] cmp $b[1] || $a[2] cmp $b[2] || $a[4] cmp $b[4] || $a[5] > cmp > >> $b[5] || $a[6] cmp $b[6] || $^a cmp $^b !! $^a cmp $^b a cmp $

Re: need sort help

2018-06-08 Thread Brandon Allbery
Brent thinkoed that slightly. (Forgot that first use of a placeholder "declares" it, and thereafter you don't use the ^. Which then collides with the local "my" variables.) > @x.sort: { >my $a = $^x ~~ m:g/\d+/; >my $b = $^y ~~ m:g/\d+/; >$a[6].defined cmp $b[6].defined >?? >

Re: need sort help

2018-06-08 Thread Brandon Allbery
gain you had $b instead). On Sat, Jun 9, 2018 at 12:19 AM ToddAndMargo wrote: > On 06/08/2018 09:16 PM, Brandon Allbery wrote: > > You didn't use what I sent. It's $^x and $^y, not $a and $b. > > I am lost. Would you mind writing it out for me? > -- brandon s allbery kf8nh

Re: mixin syntax: does vs but

2018-06-12 Thread Brandon Allbery
who have difficulty using StackOverflow for whatever reason, *they do not belong here*. On Tue, Jun 12, 2018 at 1:01 PM JJ Merelo wrote: > Hi > > El mar., 12 jun. 2018 a las 18:56, Brandon Allbery () > escribió: > >> Which doesn't change the fact that there's what amounts to

Re: mixin syntax: does vs but

2018-06-12 Thread Brandon Allbery
Smileys do not change "use … whenever possible". It;s still asserting there is one correct way to contribute. On Tue, Jun 12, 2018 at 1:07 PM Curt Tilmes wrote: > > On Tue, Jun 12, 2018 at 12:56 PM Brandon Allbery > wrote: > >> Which doesn't change the fa

Re: mixin syntax: does vs but

2018-06-12 Thread Brandon Allbery
You really do want to be exclusionary, don't you? yada yada stackoverflow is the one truth yada yada. Enough. On Tue, Jun 12, 2018 at 3:12 AM JJ Merelo wrote: > (also: ask questions in StackOverflow whenever possible :-) ) > > El mar., 12 jun. 2018 a las 9:09, JJ Merelo () > escribió: > >>

Re: mixin syntax: does vs but

2018-06-12 Thread Brandon Allbery
: ask questions in StackOverflow whenever possible :-) )" is doing exactly that. On Tue, Jun 12, 2018 at 12:51 PM JJ Merelo wrote: > > > El mar., 12 jun. 2018 a las 18:34, Brandon Allbery () > escribió: > >> You really do want to be exclusionary, don't you? >>

Re: Real, Num, Rat question

2018-05-27 Thread Brandon Allbery
"Real" is a role (a collection of common methods reusable by multiple classes/types), not itself a class/type. Similarly, "Positional" is a role which provides common methods to "Array", "List", and "Seq" among others. On Sun, May 27, 2018 at 5:50 PM ToddAndMargo wrote: >

Re: <> question

2018-06-03 Thread Brandon Allbery
zoho.com>> wrote: > >> > >> What is this? > >> > >> https://docs.perl6.org/routine/chmod#role_IO > >> > >> chmod 0o755, ; > >> > >> Is it? > >> chmod 0o755, $file1, $file2 > > O

Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
, 2018 at 6:22 PM ToddAndMargo wrote: > On 06/03/2018 03:07 PM, Brandon Allbery wrote: > > I'm still trying to figure out why you have just "lib" instead of "use > > lib" there. And why it's not throwing an error. > > As poop! I was mixing Perl 5 and Perl 6.

Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
gt;> >>>> bash: syntax error near unexpected token `=' > >> >>>> > >> >>>> Huh ??? > >> >>>> > >> >>>> > >> >>>> This is RunNoShell.pm6 > >> &g

Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
018 at 6:33 PM ToddAndMargo >> <mailto:toddandma...@zoho.com>> wrote: > >> > >> On 06/03/2018 03:24 PM, Brandon Allbery wrote: > >> > It is allowed if you have 'unit module RunNoShell;' at the top of > >> > RunN

Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
oShell("ls *.pm6"); say $a;' > >> > >>bash: syntax error near unexpected token `=' > >> > >> Huh ??? > >> > >> > >> This is RunNoShell.pm6 > >> > >> sub RunNoShell ( $RunString

Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
; >> >> <mailto:toddandma...@zoho.com <mailto:toddandma...@zoho.com>>> > >> wrote: > >> >> > >> >> On 06/03/2018 03:24 PM, Brandon Allbery wrote: > >> >> > It is allo

Re: How to print colorized text to the terminal

2018-06-03 Thread Brandon Allbery
"say" uses the .gist method, which quotes the output for readability. You probably want "put" instead. On Sun, Jun 3, 2018 at 8:42 PM Xin Cheng wrote: > Hi, > > I am trying to make a program to do grep with perl6 regular expression, > and I would like to colorize the matched part to the

Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
t; On Sun, Jun 3, 2018 at 6:33 PM ToddAndMargo > >> >> mailto:toddandma...@zoho.com> > >> <mailto:toddandma...@zoho.com <mailto:toddandma...@zoho.com>> > >> >> >> <mailto:toddandma...@zoho.com > >>

Re: need mkdir, chown, chmod, del

2018-06-03 Thread Brandon Allbery
commands. > >>> > >>> mkdir make directory > >>> chown change ownership > >>> chmod change file mode bits > >>> deldelete file > >>> > >>> > >>> Many thanks, > >>

Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
On Sun, Jun 3, 2018 at 6:33 PM ToddAndMargo wrote: > On 06/03/2018 03:24 PM, Brandon Allbery wrote: > > It is allowed if you have 'unit module RunNoShell;' at the top of > > RunNoShell.pm6. Otherwise you defined it in the main namespace and > > looking for it in the

Re: <> question

2018-06-03 Thread Brandon Allbery
On Sun, Jun 3, 2018 at 4:09 PM ToddAndMargo wrote: > $ touch a b c > $ p6 'chmod 0o777 < a b c >;' > ===SORRY!=== Error while compiling -e > Preceding context expects a term, but found infix > instead. > at -e:1 > --> chmod 0o777 < a b c >⏏; > You're missing the comma after the mode

Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
I'm still trying to figure out why you have just "lib" instead of "use lib" there. And why it's not throwing an error. On Sun, Jun 3, 2018 at 6:02 PM ToddAndMargo wrote: > On 06/03/2018 02:50 PM, Brandon Allbery wrote: > > Double quotes, or the one we were just

Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
s *.pm6"); say $a;' > >>>> > >>>> bash: syntax error near unexpected token `=' > >>>> > >>>> Huh ??? > >>>> > >>>> > >>>> This is RunNoShell.pm6 > >>>&g

Re: need mkdir, chown, chmod, del

2018-06-03 Thread Brandon Allbery
Same answer: https://docs.perl6.org/type/IO::Path is where all the path-related things live. On Sun, Jun 3, 2018 at 1:05 PM ToddAndMargo wrote: > Hi All, > > I need the Perl6 commands for the following LINUX > commands. > > mkdir make directory > chown change ownership > chmod

Re: IO ???

2018-06-03 Thread Brandon Allbery
It's a bit subtle to track down, but the IO method gives you an IO::Path object. https://docs.perl6.org/type/IO::Path On Sun, Jun 3, 2018 at 1:01 PM ToddAndMargo wrote: > Hi All, > > I have a been looking around the docs pages and I am > not finding a list of what the various IO functions do. >

Re: <> question

2018-06-03 Thread Brandon Allbery
Yes, it's a quick way to mak a list of quoted strings. Think qw() in perl 5, but < > is equivalent to single quotes whereas << >> is equivalent to double quotes. https://docs.perl6.org/language/quoting#Word_quoting:_%3C_%3E On Sun, Jun 3, 2018 at 1:42 PM ToddAndMargo wrote: > What is this? > >

Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
bash doesn't like nested single quotes, even with escapes. So the first \' gave you a literal backslash and ended the quoted part, then the second \' gave you a literal ' and continued without quoting. The final ' would then open a new quoted string, but bash doesn't get that far because it sees

Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
; and import them, if they are to be visible from outside the file they are in. If your perl 5 is older, you cannot make a "my" sub.) On Sun, Jun 3, 2018 at 10:49 PM ToddAndMargo wrote: > On 06/03/2018 06:02 PM, Brandon Allbery wrote: > > t doesn't affect export at all. It

Re: my keeper on random numbers

2018-05-27 Thread Brandon Allbery
In the long form, yes. That's why the ^ shorthand exists. With the long form you have to start from an object of the same type to get to its metamodel, then pass the object you're actually asking about to the metamodel method; the simplest way to do this is to reuse the same object. On Sun, May

Re: using run

2018-06-20 Thread Brandon Allbery
I don't manage the docs. But a ticket has already been opened: https://github.com/perl6/doc/issues/2111 On Thu, Jun 21, 2018 at 12:59 AM Todd Chester wrote: > > > On 06/20/2018 08:58 AM, Brandon Allbery wrote: > > A pipe is for communication with a process. "Piped to a

Re: .sub confusion

2018-05-01 Thread Brandon Allbery
On Tue, May 1, 2018 at 4:49 AM, ToddAndMargo wrote: > .sub is a method call and I can't write them. They come with Perl. > You can write them. But they are 'method', not 'sub', and must be defined within a class. If you put 'is export' on a method so defined, it can

Re: odd and even

2018-05-01 Thread Brandon Allbery
On Tue, May 1, 2018 at 9:17 PM, Larry Wall wrote: > On Tue, May 01, 2018 at 01:43:44AM -0700, ToddAndMargo wrote: > : The worst thing I had problems with in Perl was folks telling it > : was "Lexiconical". What? I wish they would have also said "which > : means Perl figures out

<    1   2   3   4   5   6   >