Re: : question

2017-07-28 Thread Brandon Allbery
On Fri, Jul 28, 2017 at 5:49 PM, ToddAndMargo <toddandma...@zoho.com> wrote: > On 07/28/2017 02:41 PM, Brandon Allbery wrote: >>>> >>> > That's not Perl, it's JSON generated by Perl. > > Mumble, mumble ... I have a hard enough time learning > Perl wi

Re: : question

2017-07-28 Thread Brandon Allbery
That's not Perl, it's JSON generated by Perl. On Fri, Jul 28, 2017 at 5:39 PM, ToddAndMargo wrote: > On 07/28/2017 02:02 PM, Timo Paulssen wrote: > >> The first one is valid perl 6 code and the bottom one is not. It's >> likely you were looking at JSON (or equivalently

Re: another one liner

2017-08-05 Thread Brandon Allbery
On Sat, Aug 5, 2017 at 2:50 AM, Sean McAfee wrote: > On Fri, Aug 4, 2017 at 10:18 PM, ToddAndMargo > wrote: > >> On 08/04/2017 08:43 PM, Bruce Gray wrote: >> >>> >>> P6-ish version: >>> ifconfig | perl6 -e 'say lines.map({ ~$0 if /^(\S+) ": flags="/ >>>

Re: How do I do SSL/TLS with eMail::MIME ?

2017-08-19 Thread Brandon Allbery
On Sun, Aug 20, 2017 at 12:55 AM, ToddAndMargo <toddandma...@zoho.com> wrote: > On 08/19/2017 09:51 PM, Brandon Allbery wrote: > >> I think you only want :starttls. :ssl tells it to expect a socket that >> immediately negotiates SSL; the error suggests the mail

Re: How do I do SSL/TLS with eMail::MIME ?

2017-08-19 Thread Brandon Allbery
On Sun, Aug 20, 2017 at 12:41 AM, ToddAndMargo wrote: > $client = Net::SMTP.new(:server( $smtp ), :port( $port ), :ssl, :starttls, > :debug( 1 ) ) > I think you only want :starttls. :ssl tells it to expect a socket that immediately negotiates SSL; the error suggests the

Re: parameters from the command line: how do they do that?

2017-06-22 Thread Brandon Allbery
On Thu, Jun 22, 2017 at 1:51 AM, Todd Chester wrote: > You want named parameters. >> >> sub MAIN(:$fixed-string, :$extended-regex, ...) { >> # $fixed-string and $extended-regex are Bools here, >> # True if the corresponding option specified >> } >> >>

Re: parameters from the command line: how do they do that?

2017-06-21 Thread Brandon Allbery
On Thu, Jun 22, 2017 at 1:18 AM, Todd Chester wrote: > > On 22/06/17 14:49, Todd Chester wrote: > >> I know how to read things on the command line. But > >> how to other's figure out what goes together when things > >> don't arrive in order? > > > On 06/21/2017 10:03 PM,

Re: Rakudo on JVM?

2017-05-16 Thread Brandon Allbery
On Tue, May 16, 2017 at 4:18 PM, Stephen Wilcoxon wrote: > I see in the release notes for Rakudo 2017.04, it basically says not to > use JVM backend. Why is this? Has support for the JVM been dropped? Not dropped; it's just that the JVM backend has always been more

Re: next

2017-06-16 Thread Brandon Allbery
On Fri, Jun 16, 2017 at 9:02 PM, ToddAndMargo wrote: > I am afraid I am not understanding "next" again. > > When you invoke it, does it pop you back at the start of > the loop or just cough up the next value? > The former. Or you can think of it as jumping past everything

Re: need p5 to p6 help

2017-06-11 Thread Brandon Allbery
On Sun, Jun 11, 2017 at 6:52 PM, ToddAndMargo wrote: > P6: > $ perl6 -e 'my $x="\t"; if !~ /[^A-Za-z0-9]/ {say "outside"} else {say > "inside"};' > You missed a "$x" in there. Negation works differently in perl 6 regex. /<-[A..Z a..z 0..9]>/ pyanfar «work*master» Z$ 6

Re: How do you call the variable types?

2017-06-15 Thread Brandon Allbery
On Sat, Jun 10, 2017 at 2:38 AM, Brent Laabs wrote: > I thought: > $ is Scalar > @ is Array > % is Hash > & is a function > Pedantically: $ forces item context, but otherwise allows any type (defaulting to Scalar); the item context gets you "scalar" behavior in most cases

Re: next

2017-06-18 Thread Brandon Allbery
On Mon, Jun 19, 2017 at 12:41 AM, ToddAndMargo wrote: > On 06/17/2017 12:22 AM, yary wrote: > >> last if ++$true_count == 6; >> > > ++$true_count > > Is that the same as `$true_count + 1` ? > > And does it alter the value of $true_count > Yes and yes, just like in C and

Re: Any "note" without the "say"?

2017-09-15 Thread Brandon Allbery
On Fri, Sep 15, 2017 at 3:48 PM, ToddAndMargo wrote: > Is there a similar "print" to the STDERR for when > you don't want the cr-lf inserted? > > The hard way: > $*ERR.print: "print to std err\n"; > That's it. It's not really common enough to deserve something shorter.

Re: can't adverb and infix

2017-09-19 Thread Brandon Allbery
On Tue, Sep 19, 2017 at 3:44 AM, Luca Ferrari wrote: > this will sound trivial, but the following piece of code that in my > mind should work does not: > > $mode = 'csv' if ( ! $mode.defined || %available_modes{ $mode }:!exists ); > > and the compiler says: > > You can't

Re: Why can't I "write"?

2017-09-23 Thread Brandon Allbery
On Sat, Sep 23, 2017 at 3:31 PM, Brandon Allbery <allber...@gmail.com> wrote: > On Sat, Sep 23, 2017 at 2:09 AM, ToddAndMargo <toddandma...@zoho.com> > wrote: > >> method write(IO::Handle:D: Blob:D $buf --> True) >> > > The key here is the colon *af

Re: Why can't I "write"?

2017-09-23 Thread Brandon Allbery
On Sat, Sep 23, 2017 at 2:09 AM, ToddAndMargo wrote: > method write(IO::Handle:D: Blob:D $buf --> True) > The key here is the colon *after* `IO::Handle:D`: that marks the Handle as an invocant, i.e. this is a method to be applied to an object. (The fact that it has

Re: overwrite?

2017-09-23 Thread Brandon Allbery
On Sat, Sep 23, 2017 at 2:34 AM, ToddAndMargo wrote: > I see ":truncate". This seems liek it will do the trick. > Problem: I would like to read from the file first before > truncating (ro). > > Is there a way to do this, or should I >1) open the handle with :ro >

Re: help with map and regexp

2017-09-21 Thread Brandon Allbery
On Thu, Sep 21, 2017 at 2:37 AM, Luca Ferrari wrote: > Out of cursiosity: what is the diffence between using "is copy" and "<->"? > Seems to me the map example can work with both. > <-> is the same as "is rw" and requires that the thing being bound be a mutable container,

Re: Any "note" without the "say"?

2017-09-15 Thread Brandon Allbery
On Fri, Sep 15, 2017 at 4:51 PM, ToddAndMargo <toddandma...@zoho.com> wrote: > On 09/15/2017 01:29 PM, Brandon Allbery wrote: > >> Everyone does at one time :) It's really useful for debugging, but you >> generally strip it out of production code. >> > > I saw

Re: :: question

2017-09-13 Thread Brandon Allbery
On Thu, Sep 14, 2017 at 12:46 AM, ToddAndMargo wrote: > What is the Perl6 equivalent of the perl 5 "::"? > > $Found = CheckSystemDependancy::Which ( $ProgramName, $HowToExit ); > It's the same... but unlike Perl 5, there is a difference between subs and methods, and subs

Re: stderr?

2017-09-13 Thread Brandon Allbery
On Wed, Sep 13, 2017 at 7:51 PM, ToddAndMargo wrote: > How do I print to STDERR? $*ERR? > > $ perl6 -e 'print $*ERR, "print to std err\n";' > print to std err > > What am I doing wrong? > Use the OO form: $*ERR.print: "print to std err\n"; Unlike Perl 5, there is no

Re: Who called me?

2017-09-13 Thread Brandon Allbery
On Wed, Sep 13, 2017 at 7:56 PM, ToddAndMargo wrote: > I am trying to convert this from Perl 5: > > my $WhoCalledMe = ( caller(0) )[1]; > > I use it inside a sub to determine who called the sub. > > How is this done in P6? > You want the callframe method. Note that it

Re: Who called me?

2017-09-13 Thread Brandon Allbery
On Wed, Sep 13, 2017 at 8:15 PM, ToddAndMargo wrote: > Would this be what I am looking for? > > > for 1..* -> $level { > given callframe($level) -> $frame { > when $frame ~~ CallFrame { > next unless $frame.code ~~ Routine; > say

Re: :: question

2017-09-13 Thread Brandon Allbery
On Thu, Sep 14, 2017 at 1:48 AM, Brandon Allbery <allber...@gmail.com> wrote: > If you want to use the other way, the CheckSystemDependency module MUST > define Which as: our sub Which ... > If it is not explicitly declared "our", then it is declared "my" and

Re: mtp???

2017-10-06 Thread Brandon Allbery
On Fri, Oct 6, 2017 at 6:13 PM, ToddAndMargo wrote: > The weird part is that Thunar sees and operates the thing perfectly! > Thunar has a lot fewer moving parts and uses libmtp directly. Krusader likely relies on a lot of extra KDE IPC goop implementing a virtual

Re: What is P6 for P5 `use Term::ReadKey`?

2017-09-09 Thread Brandon Allbery
On Sat, Sep 9, 2017 at 2:57 AM, ToddAndMargo wrote: > This guy maybe? > > https://github.com/krunen/term-termios/blob/master/README.md > > I can't tell what he is saying. > > And his example wont read a carriage return That's very low level. And it's disabling icrnl, so

Re: lats rakudo version from rakudobrew ?

2017-09-11 Thread Brandon Allbery
On Mon, Sep 11, 2017 at 3:40 PM, Marc Chantreux wrote: > it actually built stuff but at the end, perl6 -v still gives me 2017.05. > This is one of the gotchas of rakudobrew. It determines the version from the most recent release tag... but it uses git in default fetch mode,

Re: user and group of a file?

2017-09-26 Thread Brandon Allbery
On Tue, Sep 26, 2017 at 11:02 AM, Parrot Raiser <1parr...@gmail.com> wrote: > This is the capability provided by Perl 5's "stat". Would a clone with > the same properties and behaviours be the right thing, or are there > "features" to fix? Same features, probably. It is just one of those things

Re: Need a second pair of eyes

2017-09-25 Thread Brandon Allbery
On Mon, Sep 25, 2017 at 10:23 PM, ToddAndMargo <toddandma...@zoho.com> wrote: > On 09/25/2017 07:25 AM, Brandon Allbery wrote: > >> So as to make this not entirely content-free: I would suggest that the >> string language note the line on which it sees a bare newline, a

Re: Need a second pair of eyes

2017-09-25 Thread Brandon Allbery
On Mon, Sep 25, 2017 at 10:49 PM, ToddAndMargo wrote: > There is another operating system other than Linux? I > had heard rumors of that: it is slow, expensive, crashes > all the time. But I thought is was only a story to frighten > little children and young programmers.

Re: Need a second pair of eyes

2017-09-25 Thread Brandon Allbery
On Mon, Sep 25, 2017 at 3:09 AM, Julien Simonet wrote: > I think your problem is coming from a (") missing at line 3. > At the same line, the semicolon (;) is misplaced : it should be at the end > if line. > It took older perl over a decade to come up with better error

Re: Need a second pair of eyes

2017-09-25 Thread Brandon Allbery
rting on line ..." as a suggestion. On Mon, Sep 25, 2017 at 10:19 AM, Brandon Allbery <allber...@gmail.com> wrote: > On Mon, Sep 25, 2017 at 3:09 AM, Julien Simonet <kernel.jul...@gmail.com> > wrote: > >> I think your problem is coming from a (") missing at

Re: Need a second pair of eyes

2017-09-26 Thread Brandon Allbery
This explanation confuses me a bit, actually. (more inline) On Tue, Sep 26, 2017 at 9:45 AM, Larry Wall wrote: > In slightly greater detail, we're currently treating an undeclared > variable as a syntax error rather than a semantic error, and we treat > those differently.

Re: user and group of a file?

2017-09-26 Thread Brandon Allbery
On Tue, Sep 26, 2017 at 2:11 AM, ToddAndMargo wrote: > Does Perl 6 have one of those fancy subs that will tell me > the user and group association of a file? Or do I just > make a system call to "ls"? > At the moment you'll have to use ls. There's an ecosystem want out

Re: -f ???

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 1:09 AM, ToddAndMargo wrote: > Figured it out. The chat line told me that there is an error in the > docs. The proper way was "e" not "f" > This is not the same thing. .e will return True if it exists but is a directory, for example. I mentioned

Re: Hash and subs question

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 12:05 AM, ToddAndMargo wrote: > sub all-dimensions(% (:length(:$x), :width(:$y), :depth(:$z))) { > $x andthen $y andthen $z andthen True > } > > it turn my hash into single variables. Is there a way to > test if the right keys are present and

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: how do I assign an array to a hash key

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 12:32 AM, ToddAndMargo wrote: > $ perl6 -e 'my %x = [aaa => "x", b=>@["y","q","r"], c=>"z"]; say %x; for > @(%x) {say $_};' > {aaa => x, b => [y q r], c => z} > y > q > r > > This seems too easy. I have to have done something wrong. > What did I

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: -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: 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: 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: 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 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 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 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: 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: 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: 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: 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: 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: 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
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
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
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 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: 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: 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: 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: 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: 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
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: 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
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: 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: 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
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: 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

<    1   2   3   4   >