Re: Help me be greedy!

2017-08-04 Thread Brandon Allbery
The ? is the opposite of greedy, just as in pcre/perl 5. Greedy is the default. I also don't see why you have a .* before f if you want to capture everything before the f. On Friday, August 4, 2017, ToddAndMargo wrote: > Hi All, > > I NEED TO BE GREEDY! HAHA HAHA . > > Okay, I am back in contro

Re: Help me be greedy!

2017-08-04 Thread Brandon Allbery
gt; What am I doing wrong here? >>> >>> perl6 -e 'my $x="a b c d e f"; $x ~~ m/.*?(c.*?).*f/; say "<$0>";' >>> >>> >>> I am after >>> >>> >>> I want the space at th

Re: Need awk print sub

2017-08-04 Thread Brandon Allbery
(back on the desktop for the moment...) On Fri, Aug 4, 2017 at 5:04 PM, ToddAndMargo wrote: > On 08/04/2017 01:00 PM, ToddAndMargo wrote: > >> How do I do this with a perl one liner? >> >> $ echo "a b c d" | awk '{print $2}' >> b >> > > $ echo "a b c d" | perl6 -n -e 'say lines ~ "\n" ~ .words[

Re: Need awk print sub

2017-08-04 Thread Brandon Allbery
On Fri, Aug 4, 2017 at 6:28 PM, ToddAndMargo wrote: > Here is my last attempt: > > ip -o -f inet addr show | perl6 -e 'for ( lines ) -> $I { if ( $I ~~ /enp/ > ) { say "Interface <" ~ .words[1] ~ ">\nIP<" ~ .words[3] ~ ">"; } }' > No such method 'words' for invocant of type 'Any' > in block at

Re: Got me one too many p6's

2017-08-04 Thread Brandon Allbery
On Fri, Aug 4, 2017 at 10:50 PM, ToddAndMargo wrote: > > I renamed the one in /opt and reran "updatedb" and now > "which" find perl6 in /usr/bin instead of /opt/rakudo/bin. > > Do I need to do anything else? Arguably all you needed to do was remove /opt/rakudo/bin from $PATH, both in open shells

Re: another one liner

2017-08-04 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="/ >>> }).sort[1]' >>> >> >> > Wait a second. Ho

Re: [perl #131877] [LTA] better error message for exit("hello")

2017-08-10 Thread Brandon Allbery
At some point, one has to accept that this language is not Python, not call for one's favorite Python-isms to be incorporated into the core regardless of how it might interact with what is already there. On Thu, Aug 10, 2017 at 8:12 AM, Aleks-Daniel Jakimenko-Aleksejev via RT < perl6-bugs-follo...

Re: Running external CLI tool and capturing output

2017-08-10 Thread Brandon Allbery
"ps. security bad, correctness bad, do the simplest thing even when it's wrong." 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 error. > https://docs.perl6.org/typ

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 mail server doesn't. (Not

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 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 server doesn't. >> (Note th

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 inacc

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: > >https://irclog.perlgeek.de/perl6-dev/2017-09-04#i_15112552 > > Note t

Re: [perl #132030] [REGRESSION] Broken Text::CSV tests and possibly other ecosystem fallout

2017-09-05 Thread Brandon Allbery
On Tue, Sep 5, 2017 at 5:40 AM, jn...@jnthn.net via RT < perl6-bugs-follo...@perl.org> wrote: > Failing to close output handles has been clearly documented (and yes, > documented well before the recent buffering change) as something that can > cause data loss. Default output buffering just makes i

Re: [perl #132035] AutoReply: [LTA] temp on an undeclared dynamic variable produces a not very helpful error

2017-09-05 Thread Brandon Allbery
Or maybe it's not that tricky after all; seems the Failure is actually a useful one (X::Dynamic:NotFound), so introspection of the Failure would reveal the issue. -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com b

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 a carriage return is exa

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, which only pulls the

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 special syntactic form that

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 can be a bit more compl

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 $frame.code.package; >

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 are lexical by default (

Re: :: question

2017-09-13 Thread Brandon Allbery
On Thu, Sep 14, 2017 at 1:42 AM, ToddAndMargo wrote: > On 09/13/2017 10:26 PM, Brandon Allbery wrote: > >> On Thu, Sep 14, 2017 at 12:46 AM, ToddAndMargo > <mailto:toddandma...@zoho.com>> wrote: >> >> What is the Perl6 equivalent of the perl 5 "::&q

Re: :: question

2017-09-13 Thread Brandon Allbery
On Thu, Sep 14, 2017 at 1:48 AM, Brandon Allbery 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 the > only way

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. -- brandon s allbery kf8

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

2017-09-15 Thread Brandon Allbery
On Fri, Sep 15, 2017 at 4:02 PM, ToddAndMargo wrote: > On 09/15/2017 12:52 PM, Brandon Allbery wrote: > >> On Fri, Sep 15, 2017 at 3:48 PM, ToddAndMargo > <mailto:toddandma...@zoho.com>> wrote: >> >> Is there a similar "print" to the STDERR for

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

2017-09-15 Thread Brandon Allbery
On Fri, Sep 15, 2017 at 4:51 PM, ToddAndMargo 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 a business study somewh

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 adverb &infix:<||> > You

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, which will be altered i

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 a `type smiley`, i.e. an

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 >2) read what I want from

Re: Why can't I "write"?

2017-09-23 Thread Brandon Allbery
On Sat, Sep 23, 2017 at 3:31 PM, Brandon Allbery wrote: > 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 i

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 event in my program.

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 messages for this. Can we

Re: Need a second pair of eyes

2017-09-25 Thread Brandon Allbery
tarting on line ..." as a suggestion. On Mon, Sep 25, 2017 at 10:19 AM, Brandon Allbery wrote: > 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 mispl

Re: [perl #132156] [LTA] Suggest polymod for bases > 36 (9123607.base(37))

2017-09-25 Thread Brandon Allbery
On Mon, Sep 25, 2017 at 10:53 AM, Aleks-Daniel Jakimenko-Aleksejev via RT < perl6-bugs-follo...@perl.org> wrote: > * add a named arg for the alphabet, so that the user can provide any > character > set he wants > I'm in favor of the original suggestion: point the user to polymod. One way that is

Re: Need a second pair of eyes

2017-09-25 Thread Brandon Allbery
On Mon, Sep 25, 2017 at 10:23 PM, ToddAndMargo 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, and if it >> subsequently h

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. SAY IT ISN'T > TRUE!!

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. Syntax errors are usua

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 for a POSIX support modul

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: [perl #132148] [RFC] native 'str' type unspecced, undocumented, and ill-defined

2017-09-28 Thread Brandon Allbery
Possibly the right thing here is for perl 6 to reserve the name for implementations, and otherwise leave it unspecced. -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com ballb...@sinenomine.net unix, openafs, kerber

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 things where a proper Window

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 that doesn't run into ke

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 each key? > You should b

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 keep my hash afterwards?

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 miss? > Only that it's ev

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 '".profile".IO.f.say' True -- brandon

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 treat it like one. --

Re: -f ???

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 12:59 AM, ToddAndMargo 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 >>> usual.) >&

Re: -f ???

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 1:06 AM, Brandon Allbery wrote: > On Fri, Sep 29, 2017 at 12:59 AM, ToddAndMargo > wrote: > >> On 09/28/2017 09:53 PM, ToddAndMargo wrote: >> >>> On 09/28/2017 09:45 PM, Brandon Allbery wrote: >>> >>>> IO::Path's .

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 this in my first respons

Re: -f ???

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 1:10 AM, Brandon Allbery 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 can also be done with

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 cou

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 string is a single thing; it

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 prepend? > No, sorry. The d

Re: Need append help

2017-09-29 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 2:32 PM, Sean McAfee wrote: > On Fri, Sep 29, 2017 at 11:27 AM, Brandon Allbery > wrote: > >> On Fri, Sep 29, 2017 at 2:04 PM, ToddAndMargo >> wrote: >> >>> >>> Question: Is thee a pretty way like the above to do a prepend

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

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 compiling -e > Missing req

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 the past 2 days that I p

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 retrieve values. The point o

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 Perl 5 (or > other programming

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 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" data all in one easy t

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 researching. It did not > go in

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 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 impossible to >> manage, almo

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 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 interpolates variables but not gen

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 > word correctly, then how

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 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 <http://f

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 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 can use { } to >> insert t

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 --- although it will probably work on t

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 at object initializa

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 > *BUILD* and *TWE

Re: mtp???

2017-10-06 Thread Brandon Allbery
On Fri, Oct 6, 2017 at 5:53 PM, ToddAndMargo wrote: > I would like to write a backup program to backup up > my wife's files. > > Question: how do I access mtp://[usb:002,010] from > both the command line and from Perl 6? > No MTP support module for Perl 6 as yet. There's a suite of command line

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 filesystem layer sitting between

Re: [perl #126757] [LTA] error message talks about ~ but there is no ~ in my code (33..126 .pick.chr)

2017-10-07 Thread Brandon Allbery
Is it possible to signal to the error handler that it is talking about a value somewhere instead of the program source, at least? Even if you can't reasonably say what value where? On Sat, Oct 7, 2017 at 5:18 PM, Aleks-Daniel Jakimenko-Aleksejev via RT < perl6-bugs-follo...@perl.org> wrote: > “Co

Re: [perl #132242] [BUG] Proc::Async running with yes command returns superfluous output and hangs

2017-10-07 Thread Brandon Allbery
On Sat, Oct 7, 2017 at 10:21 PM, Itsuki Toyota wrote: > See the following result: > > $ perl6 -e 'my $proc = Proc::Async.new("yes"); > $proc.stdout.head(1).tap(&say); await $proc.start;' > > y > y > y > y > y > y > y > y > ... > > > I think tap(&say) should output just a 'y' char and completes it

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 1.001e0;' > 1 > > $ perl

Re: [perl #132268] Floating point anomalies

2017-10-13 Thread Brandon Allbery
On Fri, Oct 13, 2017 at 4:59 AM, wrote: > It's bad enough that perl5 and perl6 round to 15 decimal digits of > precision, but at least perl5's printf will give me 17 decimal digits when > I ask it to (and I think perl6 should do the same): > I am wondering if youve talked to any Intel FP enginee

Re: [perl #132302] Str.trans grabs callers $/ for unknown reason

2017-10-14 Thread Brandon Allbery
On Sat, Oct 14, 2017 at 1:15 PM, Zoffix Znet wrote: > 2) Why does Str.trans grabs caller's $/ in the first place? The commit > that added >it seems to claim to fix something that isn't meant to work as tr/// > replaces per >char and doesn't use special regex syntax (basically, author of t

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 t

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 who pays my labor to >>> write it, who ow

Re: who own my code?

2017-10-22 Thread Brandon Allbery
This is still best discussed elsewhere... isn't there a stackexchange for this kind of stuff? On Sun, Oct 22, 2017 at 4:24 PM, vijayvithal jahagirdar < jahagirdar...@gmail.com> wrote: > Now If I implement this for one customer does the code becomes his IP and > I cannot implement it for another?

Re: who own my code?

2017-10-23 Thread Brandon Allbery
On Mon, Oct 23, 2017 at 1:47 AM, Jan Ingvoldstad wrote: > On Sun, Oct 22, 2017 at 10:32 PM, Brandon Allbery > wrote: > > This is still best discussed elsewhere... isn't there a stackexchange for > > this kind of stuff? > > Ah, Stack Exchange, the quality site wh

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 license on any code you releas

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 can only take Int values

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 (not 64) than? > > http://r

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- > programming-feature-that-no-language-h

Re: [perl #132441] [SEVERE][WINDOWS][IO] IO::Handle.read-internal cannot handle fancy Unicode chars on TTY handles

2017-12-25 Thread Brandon Allbery
On Mon, Dec 25, 2017 at 1:07 AM, Zoffix Znet via RT < perl6-bugs-follo...@perl.org> wrote: > On Thu, 16 Nov 2017 09:53:46 -0800, c...@zoffix.com wrote: > > On 2017.07 on Win7 with 65001 code page enabled, the » char doesn't > > show up at all. Just seems to get removed from the content if I paste

Re: [perl #132441] [SEVERE][WINDOWS][IO] IO::Handle.read-internal cannot handle fancy Unicode chars on TTY handles

2017-12-25 Thread Brandon Allbery
On Tue, Dec 26, 2017 at 12:15 AM, Brandon Allbery via RT < perl6-bugs-follo...@perl.org> wrote: > IIRC this is known, and not really fixable. It's not even cmd.exe but a > Windows console mode limitation. > Come to think of it, there should be existing mention of this on th

Re: How to accomplish a method interpolation?

2017-12-30 Thread Brandon Allbery
I think this is just name collision; this sounds like a dungeon crawler type thing and it's a "bag of holding". On Sat, Dec 30, 2017 at 6:45 AM, Elizabeth Mattijsen wrote: > > On 30 Dec 2017, at 06:13, clasclin . wrote: > > > > I'm reading a book "Make your own python text adventure" and decide

Re: How to accomplish a method interpolation?

2017-12-30 Thread Brandon Allbery
e out how the container associated with each key works, you build that into the object. On Sat, Dec 30, 2017 at 7:07 AM, Elizabeth Mattijsen wrote: > But that's the kind of semantic that Bag/BagHashes are meant to perform: a > "bag of holding”! Or am I missing something? > > >

Re: Chained sequence operators

2018-01-26 Thread Brandon Allbery
You probably want an enum to get that behavior. Strings are strings; Perl has no idea what they mean. On Fri, Jan 26, 2018 at 4:45 PM, ToddAndMargo wrote: > Sweet! > $ perl6 -e 'my $x=(1...5...1); say $x;' > (1 2 3 4 5 4 3 2 1) > > Characters too! > $ perl6 -e 'my $x=("a"..."f"..."a"); say $x;'

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

2018-03-03 Thread Brandon Allbery
Max precision rapidly becomes more memory requires than your computer has. On Sat, Mar 3, 2018 at 3:32 PM, yary wrote: > Or instead of 1/2**(32 or 64), re-asking these questions about epsilon: > > " Why so large? > >Why not zero? " > > What's justification for using 1/100,000 vs. something

Re: [perl #127682] [OSX] writing more than 8192 bytes to IO::Handle causes it to hang forever

2018-03-07 Thread Brandon Allbery
And in the cases where it "works", the buffer is larger. Which runs the risk of consuming all available memory in the worst case, if someone tries to "make it work" with an expanding buffer. The fundamental deadlock between processes blocked on I/O is not solved by buffering. Something needs to act

Re: Does words have a delimiter?

2018-04-13 Thread Brandon Allbery
"words" is just a shorthand for a common invocation of "split", really. On Sat, Apr 14, 2018 at 1:27 AM, ToddAndMargo wrote: > Hi All, > > I am over on > https://docs.perl6.org/routine/words > and I can't make heads of tails out of it. > > Does "words" have a delimiter, as does "-F" with awk

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 your variables t

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 become a sub at the same ti

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 yourself, by wrapping it

Re: I need `dir` help

2018-05-10 Thread Brandon Allbery
On Thu, May 10, 2018 at 7:49 PM, ToddAndMargo wrote: > On 05/10/2018 04:43 PM, Brandon Allbery wrote: > >> On Thu, May 10, 2018 at 7:34 PM, ToddAndMargo > <mailto:toddandma...@zoho.com>> wrote: >> It will be easier to track this if you capture into an array (@x inst

Re: I need `dir` help

2018-05-10 Thread Brandon Allbery
ToddAndMargo wrote: > >> On 05/10/2018 04:43 PM, Brandon Allbery wrote: >> >>> On Thu, May 10, 2018 at 7:34 PM, ToddAndMargo >> <mailto:toddandma...@zoho.com>> wrote: >>> >>> https://docs.perl6.org/routine/dir <https://

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 Thu

<    1   2   3   4   5   6   >