Re: Perl6 and wxwidgets

2014-06-08 Thread Brandon Allbery
On Sun, Jun 8, 2014 at 6:54 AM, Erik Colson e...@ecocode.net wrote: Is it possible to use an external C-library like wxwidgets from perl6/moarvm ? If so, is there any doc how this can be achieved ? wxwidgets may actually be a bit difficult, since it's not a C library. It's C++, and that is

Re: Could you give me some explanatio​ns about regex?

2014-07-15 Thread Brandon Allbery
On Tue, Jul 15, 2014 at 11:16 AM, MAX PUX isleof...@gmail.com wrote: I expected this output: website ForeignAssistance ForeignAssistanceRow AssistanceType RecipientCountry ProgramName but the output was: └website┐ └ForeignAssistance┐ └ForeignAssistanceRow┐ $/[0] is a Match

Re: Need help with: Cannot find method 'postcircumfix:( )'...

2015-03-19 Thread Brandon Allbery
On Thu, Mar 19, 2015 at 10:33 PM, Tom Browder tom.brow...@gmail.com wrote: Why do you say that is not a method? The first line says Sorry, somehow I managed to misread that. So you want what I have already said twice: the accessor `self.elem`. If you want to access the variable directly for

Re: Need help with: Cannot find method 'postcircumfix:( )'...

2015-03-19 Thread Brandon Allbery
On Thu, Mar 19, 2015 at 9:32 PM, Tom Browder tom.brow...@gmail.com wrote: if (self.$elem) { # === LINE 995 === LINE 995 This is an indirect method call. Is that really what you intended? If you wanted the `my` variable, it's just `$elem`. If you somehow have an object in

Re: Need help with: Cannot find method 'postcircumfix:( )'...

2015-03-19 Thread Brandon Allbery
On Thu, Mar 19, 2015 at 10:26 PM, Tom Browder tom.brow...@gmail.com wrote: On Mar 19, 2015 8:58 PM, Brandon Allbery allber...@gmail.com wrote: On Thu, Mar 19, 2015 at 9:32 PM, Tom Browder tom.brow...@gmail.com wrote: if (self.$elem) { # === LINE 995 === LINE 995

Re: Perl 6 script beginning lines: 'v6;' required?

2015-03-13 Thread Brandon Allbery
On Fri, Mar 13, 2015 at 8:54 AM, Rob Hoelz r...@hoelz.ro wrote: On Fri, 13 Mar 2015 07:13:31 -0500 Tom Browder tom.brow...@gmail.com wrote: I have seen the following beginning lines of Perl programs in some examples on the Perl 6 web site: #!/usr/bin/env perl6 v6; Isn't the

Re: Problem found with PERL6LIB environment variable

2015-06-08 Thread Brandon Allbery
On Mon, Jun 8, 2015 at 3:09 PM, Fields, Christopher J cjfie...@illinois.edu wrote: I had the same problem recently, tied to the revised path names (e.g. the ‘file#’ prefix). Any reason for the change? Kinda caught me by surprise. It's so that there can be things that are not directories of

Re: help installing Inline::Perl5

2015-06-07 Thread Brandon Allbery
On Sun, Jun 7, 2015 at 7:43 PM, RB reneb.ma...@gmail.com wrote: This is perl6 version 2015.03 built on MoarVM version 2015.03 Recent Panda requires a recent Rakudo; the unit change happened in the last 2 weeks. -- brandon s allbery kf8nh sine nomine associates

Re: Sub args: choose one of two?

2015-07-02 Thread Brandon Allbery
On Thu, Jul 2, 2015 at 3:08 PM, Tom Browder tom.brow...@gmail.com wrote: 1. Write the 'main' program as another subroutine and call it from each of the appropriate multi subs--aarghh! This seems like the right one to me; it also makes it easier to provide similar functionality as a library.

Re: Proposed new string methods: trim-rw, trim-leading-rw, trim-trailing-rw

2015-08-14 Thread Brandon Allbery
On Fri, Aug 14, 2015 at 8:07 AM, Tom Browder tom.brow...@gmail.com wrote: But I've tried it and it works (but the syntax still bothers me for now). Note that the same behavior applies to the 'substr' string method so that begs the question of why is the 'substr-rw' method justified and

Re: String trim method

2015-08-05 Thread Brandon Allbery
On Wed, Aug 5, 2015 at 6:47 PM, Tom Browder tom.brow...@gmail.com wrote: I see that to trim white space from a strings's both ends I have to do this: my $s = ' yada yada '; $s = $s.trim; Is that the optimum way? I don't know what you mean by optimal there, but you can say

Re: What are Perl 6's killer advantages over Perl 5?

2015-08-26 Thread Brandon Allbery
On Wed, Aug 26, 2015 at 1:58 PM, Elizabeth Mattijsen l...@dijkmat.nl wrote: It used to be, but that was not according to spec. FROGGS++ implemented the lax mode, which is enabled by default in one-liners. Perhaps TimToady wants to invoke rule #2 on this. Personally, I use an alias that has

Re: Recalling previous commands

2016-01-01 Thread Brandon Allbery
On Fri, Jan 1, 2016 at 4:47 PM, Parrot Raiser <1parr...@gmail.com> wrote: > Every time I make a typo in a complex command, I reflexively hit > ctrl-k before remembering I'm not in bash any more. :-)* > ...ctrl-k? wtf is bash misteaching people any more? I'd expect ctrl-p, like pretty much

Re: perl 6 for rhel?

2016-01-10 Thread Brandon Allbery
On Mon, Jan 11, 2016 at 2:02 AM, ToddAndMargo wrote: > Anyone know if Perl 6 will be available for Red Hat Enterprise > Linux 7 any time soon? > That's up to Red Hat. Considering that they refuse to fix their Perl 5 packaging which has been fundamentally broken (not to

Re: "with" definedness check

2016-06-06 Thread Brandon Allbery
On Mon, Jun 6, 2016 at 3:45 PM, yary wrote: > On Mon, Jun 6, 2016 at 3:27 PM, Elizabeth Mattijsen > wrote: > > “with” is completely agnostic about what it is working on. It merely > checks for definedness and sets the topicalizer if so. > > Hmm- what's the

Re: NativeCall interface for a char ** argument

2016-05-25 Thread Brandon Allbery
On Wed, May 25, 2016 at 2:41 PM, Fernando Santagata < nando.santag...@gmail.com> wrote: > > gbooleannotify_get_server_info (char **ret_name, > char **ret_vendor, > char **ret_version, >

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

2016-01-16 Thread Brandon Allbery
On Sat, Jan 16, 2016 at 1:40 PM, James E Keenan wrote: > Is there a timeline for the release of a Rakudo Star with 6.c? > I don't think there is a specific timeline, but given the rakudo bug fixes since 6.c (in particular with CompUnitRepo, which would have made it difficult

Re: Confused about rakudobrew and Rakudo Star

2016-02-04 Thread Brandon Allbery
On Thu, Feb 4, 2016 at 7:44 AM, Brock Wilcox wrote: > I see Moritz replied to this also saying that the tarball is the way to > go. I'd love to know what I'm missing out on by doing it this way. > Probably nothing right now. The big issue will come later: rakudo

Re: run "...", :out forgetting about the exit code?

2016-02-02 Thread Brandon Allbery
On Tue, Feb 2, 2016 at 6:37 PM, Peter Pentchev wrote: > So, uhm, what am I missing? Shouldn't $p.exitcode remain 1 no matter > whether > I've invoked run() with or without :out? Should I file a bug? > https://rt.perl.org/Ticket/Display.html?id=125757 -- brandon s allbery

Re: Need help with Nil values

2016-02-22 Thread Brandon Allbery
On Mon, Feb 22, 2016 at 9:15 PM, TS xx wrote: > I expect $.value to hold Strings, but I want to be able to instantiate > MyClass whether I have a value already or not, and I also want to be able > to tell if $.value has a real String or not. Is this possible? You don't

Re: '!' versus 'not' in boolean expression

2016-01-25 Thread Brandon Allbery
On Mon, Jan 25, 2016 at 2:42 PM, Carl Mäsak wrote: > >> my %h; say 'false' if !%h:exists; > > Unexpected named parameter 'exists' passed By the way, is it me or would it be a lot more appropriate and helpful if this error said *what* it was passed to? -- brandon s allbery

Re: Nice-to-have class methods

2016-01-27 Thread Brandon Allbery
On Wed, Jan 27, 2016 at 9:50 AM, Peter Pentchev wrote: > Right, so that would probably mean that you need a function that removes > the *last* extension; that might indeed make sense, although it's > trivial to implement as a regular expression substitution (but also beware >

Re: can a method name contain a funny character?

2016-04-12 Thread Brandon Allbery
On Tue, Apr 12, 2016 at 6:07 PM, Darren Duncan <dar...@darrenduncan.net> wrote: > On 2016-04-12 6:59 AM, Brandon Allbery wrote: > >> On Tue, Apr 12, 2016 at 9:51 AM, Brock Wilcox <awwa...@thelackthereof.org> >> wrote: >> Heart doesn't work for me, but o

Re: can a method name contain a funny character?

2016-04-12 Thread Brandon Allbery
On Tue, Apr 12, 2016 at 9:51 AM, Brock Wilcox wrote: > Heart doesn't work for me, but other symbols seem fine. I don't know why. > I also didn't need to quote them. Here is a REPL session from a > Rakudo 2016.01.1: > > > sub Δ($x) { say "got $x" } > > Δ is a perfectly

Re: A practical benchmark shows speed challenges for Perl 6

2016-04-01 Thread Brandon Allbery
On Fri, Apr 1, 2016 at 11:09 AM, yary wrote: > Setting the buffer size is better done by the user, not the > programmer. Often the user and the programmer are one and the same, in > which case, the programmer knows the environment and can set the > environment variables- or

Re: testing with a "warn"

2016-04-29 Thread Brandon Allbery
On Fri, Apr 29, 2016 at 1:25 AM, Richard Hainsworth wrote: > throws-like { abc('excess') }, Exception, 'got the exception', message => > / excess recursion /; I'm confused as to why you would expect this to work. The point of warn is it is *not* an exception; an exception by

Re: testing with a "warn"

2016-04-29 Thread Brandon Allbery
On Fri, Apr 29, 2016 at 3:47 PM, Brandon Allbery <allber...@gmail.com> wrote: > Oh, they are resumable exceptions? Useful but rather high cost I'd think. > (Granting that perl6 isn't one of those languages that think exceptions > should be normal control flow. But anyone who de

Re: select (3)

2016-04-30 Thread Brandon Allbery
On Sat, Apr 30, 2016 at 4:35 AM, Kaare Rasmussen wrote: > my $nfds = dup(0); > Note that "nfds" is the highest fd number to check for, plus one. For the naïve implementation, you need to add one here. my $readfds = CArray[uint8].new(0, 2); > What is this initialized to? The

Re: poll (3) (WAS select (3))

2016-04-30 Thread Brandon Allbery
On Sat, Apr 30, 2016 at 3:05 PM, Kaare Rasmussen wrote: > sub poll(CArray[Pollfd], uint64, uint32) returns int32 is native { * } This, unfortunately, means an array of pointers to Pollfd structs, not an array of Pollfd structs. NativeCall doesn't support the latter currently,

Re: Fwd: perl6 INC

2016-05-11 Thread Brandon Allbery
On Wed, May 11, 2016 at 10:46 AM, Moritz Lenz wrote: > On 05/11/2016 04:30 PM, Bennett Todd wrote: > >> Thanks for the explanation. Sounds like an unfortunate situation, rather >> than letting the system admin choose modules within the limits of >> filesystem namespace, it's

Re: testing with a "warn"

2016-04-29 Thread Brandon Allbery
On Fri, Apr 29, 2016 at 6:45 PM, Larry Wall wrote: > If you need to produce actual warnings in hot code, something's wrong > with your design. (If you just want to print to STDERR, you can use > 'note' instead.) > The latter's more what I was getting at, yes. -- brandon s

Re: NativeCall interface for a char ** argument

2016-05-25 Thread Brandon Allbery
On Wed, May 25, 2016 at 11:50 AM, Fernando Santagata < nando.santag...@gmail.com> wrote: > When I write a C program I'm able to call that function and I receive the > strings, so I guess my problem is just a mapping one. It can also mean a preallocated array of strings, though; C is sloppy

Re: function name in a variable

2016-08-09 Thread Brandon Allbery
On Tue, Aug 9, 2016 at 3:49 AM, Theo van den Heuvel wrote: > I have string variable and want to execute a function with that name. How > do I call that function? > > sub bar { say "Hi" } > my $subname = 'bar'; > > # how to call the sub whose name I have? >

Re: syntax highlighting - uses other than atom?

2017-01-27 Thread Brandon Allbery
On Wed, Jan 25, 2017 at 4:00 AM, Richard Hainsworth wrote: > Lots of traffic on this group about syntax highlighting, which indicates > the work has a broad application. Or just that it's especially useful; as I understand it, this code is also used by github's syntax

Re: print to STDERR problem

2017-02-18 Thread Brandon Allbery
On Sat, Feb 18, 2017 at 10:33 PM, ToddAndMargo wrote: > am having issues writing to STDERR. I am using this as > a reference: >https://perl6.org/archive/rfc/30.html > >The p52p6 translator needs to be able to spot >instances of barewords and globs

Re: what is ".perl"?

2017-02-17 Thread Brandon Allbery
On Fri, Feb 17, 2017 at 9:47 PM, ToddAndMargo wrote: > What is the difference between these two commands and why would > you use ".perl"? > >say "$ServiceName"; >say $ServiceName.perl; > The first uses .gist, which produces a summary of an object ("just the

Re: print to STDERR problem

2017-02-19 Thread Brandon Allbery
On Sun, Feb 19, 2017 at 10:14 AM, Timo Paulssen wrote: > Can you suggest how to improve the warnings about its obsolescence? Right > now it says: They wanted to use a perl 5 to perl 6 converter. They were warned that all such had not been maintained in some time and were

Re: dry run?

2017-01-15 Thread Brandon Allbery
On Sun, Jan 15, 2017 at 5:32 AM, Richard Hainsworth wrote: > Is your Perl (cap P) below correct? They are doing at least some of this on Windows, so the case doesn't matter. -- brandon s allbery kf8nh sine nomine associates

Re: Your thoughts on Padre?

2017-02-27 Thread Brandon Allbery
On Mon, Feb 27, 2017 at 9:39 AM, Luca Ferrari <fluca1...@infinito.it> wrote: > On Sat, Feb 25, 2017 at 1:26 AM, Brandon Allbery <allber...@gmail.com> > wrote: > > Padre's maintained? I thought it died years ago. > > Seems to me it is one year old now: > <https

Re: Terminal::ANSIColor problem

2017-02-26 Thread Brandon Allbery
On Sun, Feb 26, 2017 at 8:14 PM, ToddAndMargo wrote: > Speaking of syntax errors, what is wrong with these > two lines (not used a the same time)? > > use Terminal::ANSIColor qw[ color ]; > use Terminal::ANSIColor::color; > The first one attempts to import a symbol

Re: Terminal::ANSIColor problem

2017-02-26 Thread Brandon Allbery
On Sun, Feb 26, 2017 at 9:38 PM, ToddAndMargo <toddandma...@zoho.com> wrote: > On 02/26/2017 06:02 PM, Brandon Allbery wrote: >> >> On Sun, Feb 26, 2017 at 8:14 PM, ToddAndMargo <toddandma...@zoho.com >> <mailto:toddandma...@zoho.com>> wrote: >> &g

Re: debugging and HookGrammar

2017-02-28 Thread Brandon Allbery
On Tue, Feb 28, 2017 at 9:24 AM, Theo van den Heuvel wrote: > I reinstalled without rakudobrew. It helped. I will probably never know > what I did wrong with rakudobrew (possible traces of an older install). One thing it does wrong is it doesn't fetch tags for its repos,

Re: can Perl 6 bootstrap itself

2016-08-25 Thread Brandon Allbery
On Thu, Aug 25, 2016 at 6:03 PM, Dipesh Sharma wrote: > is bash version n-1 needed to build bash version n? This is pretty much the definition of "self-bootstrapping". For some things it is considered good; for others, bad. -- brandon s allbery kf8nh

Re: pull results out of a variable

2016-09-28 Thread Brandon Allbery
On Wed, Sep 28, 2016 at 5:15 PM, Nex6 via perl6-users wrote: > my $results = run 'ping', '-c', '1',$line; > > where $line is the IP address, $results hold the result how can i pull the > results out? it outputs like this: > Actually, it doesn't have them with that

Re: What are variables/parameters that start with a pipe | char

2016-09-30 Thread Brandon Allbery
On Fri, Sep 30, 2016 at 10:22 PM, Francis (Grizzly) Smit wrote: > I keep finding stuff like this: > > multi method spurt(IO::Path:D: Blob $contents, :$bin, |c)multi method > spurt(IO::Path:D: Cool $contents, :$bin, |c) > > > but I cannot find the |c syntax in the docs I

Re: rakudo bug 128427 perl 5 does not build on Darwin platforms with clock_gettime

2016-11-15 Thread Brandon Allbery
On Tue, Nov 15, 2016 at 8:53 AM, Andy Bach wrote: > > Well, I just nuked and built moar-nom here OSX 10.11.6/Xcode 8 > This is not a MoarVM problem; it's a bug in the Xcode 8 (and 8.1) Command Line Tools and documented (poorly) in the Xcode 8 release notes. You must download

Re: What is rakudo-star?

2016-11-18 Thread Brandon Allbery
Star is the packaged, stable release for users. It's what you will find in most package managers. People working on rakudo itself work out of git or use unstable snapshot releases. On Fri, Nov 18, 2016 at 8:54 PM, ToddAndMargo wrote: > Is this the right perl 6 for Fedora?

Re: perl 5?

2016-11-17 Thread Brandon Allbery
On Thu, Nov 17, 2016 at 2:08 AM, ToddAndMargo wrote: > Would you guys tolerate a perl 5 question every so often? Quite a few of the folks who work on Perl 6 don't know Perl 5, or at least know it only incidentally. -- brandon s allbery kf8nh

Re: autodie???

2016-11-20 Thread Brandon Allbery
On Mon, Nov 21, 2016 at 12:06 AM, ToddAndMargo wrote: > My concern is that it will affect the operation of perl 5 It's a pragma that has to be explicitly enabled (`use autodie; ...`). It won't change the default behavior. -- brandon s allbery kf8nh

Re: autodie???

2016-11-20 Thread Brandon Allbery
On Sun, Nov 20, 2016 at 10:21 PM, ToddAndMargo wrote: > What does perl-autodie do (RHEL 7)? > > yum install perl-autodie > > And why is it necessary to get Perl 6 to work? > It's normally part of a Perl install, but RH loves to break Perl by installing only about half of

Re: perl 6 equivalent of "use warnings"

2017-01-11 Thread Brandon Allbery
Instead of enabling warnings, you disable them on a case by case basis with "quietly" e.g. perl6 -e 'my $foo; quietly say "is $foo"'. Likewise, "strict" is the default. On Thu, Jan 12, 2017 at 12:12 AM, Lloyd Fournier wrote: > Nope. Perl6 warns you without asking for it.

Re: Simple windows code example needed

2017-01-11 Thread Brandon Allbery
On Thu, Jan 12, 2017 at 12:11 AM, Lloyd Fournier wrote: > say "hello world"; > or on the command line: > perl6 -e 'say "hello world"' > > There are no headers :) > I parsed that request as asking how to write a GUI program, fwiw. -- brandon s allbery kf8nh

Re: Need dynamic variables help

2017-01-13 Thread Brandon Allbery
On Fri, Jan 13, 2017 at 4:33 AM, Todd Chester wrote: > Will "~" > always replace "+" for this, or only with a dynamic variable? > ~ is always string concatenation; + is never correct for strings unless you want to coerce the string to a number (which is what led to your

Re: Any trick to installing a module in Windows?

2017-01-13 Thread Brandon Allbery
On Fri, Jan 13, 2017 at 10:51 PM, ToddAndMargo wrote: > What ports are panda using other than git? This is not a fault in panda. The Net::FTP module implements the FTP protocol, which runs on TCP ports 20 and 21 --- but in active mode it will attempt to connect back to

Re: Any trick to installing a module in Windows?

2017-01-13 Thread Brandon Allbery
On Fri, Jan 13, 2017 at 10:45 PM, ToddAndMargo wrote: > I am trying to install Net::FTP in Windows 7. Panda's install > is error city. > I am guessing you have to either suppress the tests or (perhaps more likely) provide an FTP proxy of some kind, based on the errors

Re: Subroutine question

2017-01-13 Thread Brandon Allbery
On Fri, Jan 13, 2017 at 9:50 PM, ToddAndMargo wrote: > Is their example a boo-boo? > :$type, # Optional > > How is this "optional" when "!" is the default? > > You misunderstood that section: it is the default only for positional parameters. -- brandon s allbery

Re: Subroutine question

2017-01-13 Thread Brandon Allbery
On Fri, Jan 13, 2017 at 10:32 PM, ToddAndMargo wrote: > I almost understand what you said. What do you/they mean by > "positional parameters"? > foo(1, 5, :bar) 1 and 5 are positional: what they represent can only be determined by knowing their position in the parameter

Re: Need dynamic variables help

2017-01-13 Thread Brandon Allbery
On Fri, Jan 13, 2017 at 4:33 AM, Todd Chester wrote: > I was using Perl5's string concatenation That uses ., not +. Quite a few other languages use + though. -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com

Re: zenity sub

2016-12-01 Thread Brandon Allbery
On Thu, Dec 1, 2016 at 2:45 PM, Brandon Allbery <allber...@gmail.com> wrote: > Largely because making it work in native perl 6 is not all that trivial; > that oh so "simple" popup has a full featured, mature widget toolkit and > graphics interface behind it, and uses, or

Re: zenity sub

2016-12-01 Thread Brandon Allbery
On Thu, Dec 1, 2016 at 2:38 PM, ToddAndMargo wrote: > Quoting constructs as a perl 6replacement for zenity pop up windows? They're suggesting that, given an existing program specifically intended for providing pop-ups fo rother programs, why not use it? Largely because

Re: serial communication over usb on linux

2017-01-02 Thread Brandon Allbery
On Mon, Jan 2, 2017 at 11:11 PM, ToddAndMargo wrote: > When using "Inline", do you have to convert arrays to > references first? > Can you provide a specific example? My basic rule is "if you are calling something p5ish from p6, if it expects an arrayref you give it an

Re: Any trick to installing a module in Windows?

2017-01-14 Thread Brandon Allbery
On Sat, Jan 14, 2017 at 10:10 PM, ToddAndMargo wrote: > I am confused. Why in the world would panda be executing ftp code > when it is compiling/installing a module? Who told it the name of > the FTP server? Who told it the username and password? > It's running module

Re: maintainability and "or"

2017-03-21 Thread Brandon Allbery
On Tue, Mar 21, 2017 at 7:50 AM, Elizabeth Mattijsen wrote: > $PathAndName.IO.open(:w).close unless $PathAndName.IO.f; This has a readability issue, though: you've buried the lede. The condition should be up front where it stands out, not hidden at the back. The wide usage

Re: Is this file check backwards?

2017-03-21 Thread Brandon Allbery
On Tue, Mar 21, 2017 at 5:52 AM, ToddAndMargo wrote: > Sound backwards to me. What am I missing? Conditionals in all language have a semantic gap issue. Test conditions are often the reverse of what makes for good code --- which is why you find inverted conditionals in

Re: maintainability and "or"

2017-03-21 Thread Brandon Allbery
On Tue, Mar 21, 2017 at 7:38 AM, ToddAndMargo wrote: > $Name.IO.f or $Name.IO.open(:w).close; fwiw I consider this a perl3_to_5-ism; it's an optimization, and a fairly poor one for readability and maintainability, but one that used to be fairly important (people

Re: maintainability and "or"

2017-03-21 Thread Brandon Allbery
On Tue, Mar 21, 2017 at 2:37 PM, Patrick R. Michaud <pmich...@pobox.com> wrote: > On Tue, Mar 21, 2017 at 02:25:02PM -0400, Brandon Allbery wrote: > > On Tue, Mar 21, 2017 at 7:38 AM, ToddAndMargo <toddandma...@zoho.com> > wrote: > > > $Name.IO.f or $Name.

Re: Am I suppose to be able to change a variable's type on the fly?

2017-03-28 Thread Brandon Allbery
On Tue, Mar 28, 2017 at 3:09 AM, Francesco Rivetti wrote: > you don't change the type of a variable. instead you use a type which is > "broader" and accept any object type. This; and if you didn't specify a type, the type is Any. Which is not quite the root of the class/type

Re: regex and performance question

2017-03-27 Thread Brandon Allbery
On Mon, Mar 27, 2017 at 1:10 PM, ToddAndMargo wrote: > Am I reintroducing a "regex" It's a junction, not a regex. But junctions are even slower than regexes: they are, in effect, trying to emulate a quantum computer. I suspect it's doubly slow because not only are

Re: Can this OR be shortened?

2017-03-24 Thread Brandon Allbery
On Fri, Mar 24, 2017 at 8:58 PM, ToddAndMargo wrote: > if $Terminal ~~ /xterm/ || /linux/ {} if $Terminal ~~ /xterm || linux/ {} -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com

Re: Global search and replace inside string

2017-03-22 Thread Brandon Allbery
On Wed, Mar 22, 2017 at 2:50 PM, Chris Ramsey wrote: > > my $str = "some string with 'text' in it and more text"; > say $str.subst(/'.*'/, "'m'", :g); > > When running this code, I get the original string back, which makes me > think my regex isn't quite right. > > Basically

Re: Can this OR be shortened?

2017-03-25 Thread Brandon Allbery
On Fri, Mar 24, 2017 at 10:45 PM, Brad Gilbert wrote: > Basically use | in regexes unless you need ||. There's been some discussion, here and in IRC, of the | form interacting in ways that are correct but which people often don't expect. This can result in match failures or

Re: #!/usr/bin/perl6

2017-04-01 Thread Brandon Allbery
On Sat, Apr 1, 2017 at 6:01 PM, ToddAndMargo wrote: > On 04/01/2017 03:52 AM, Francis (Grizzly) Smit wrote: > >> #!/usr/bin/env perl6 >> >> is probably better let /usr/bin/env find the path to perl6 >> > > What do you mean? > `env` does a $PATH search, and usually is in

Re: How do I call system functions?

2017-03-08 Thread Brandon Allbery
On Wed, Mar 8, 2017 at 1:00 PM, ToddAndMargo <toddandma...@zoho.com> wrote: > On 03/08/2017 07:49 AM, Brandon Allbery wrote: > >> >> On Wed, Mar 8, 2017 at 5:51 AM, ToddAndMargo <toddandma...@zoho.com >> <mailto:toddandma...@zoho.com>> wrote: >&g

Re: Need help with a match

2017-03-13 Thread Brandon Allbery
You have two problems: (1) matches start from 0, not 1. (2) .* gobbles as much as possible (this is also true in Perl 5) so it matches to the ) at the end of (Sub|63218616). As in Perl 5, you add a ? to make it take the shortest match instead: #!/usr/bin/perl6 my $x='sub Test () {

Re: Need help with a match

2017-03-13 Thread Brandon Allbery
before the literal open paren so you don't also eat any spaces there.) #!/usr/bin/perl6 my $x='sub Test () { #`(Sub|63218616) ... }'; $x ~~ m/sub <.ws> (.*?) <.ws> \(/; say "$x\n$0"; On Mon, Mar 13, 2017 at 10:52 PM, Brandon Allbery <allber...@gmail.com> wrote: > Y

Re: more match humility

2017-03-13 Thread Brandon Allbery
Just to be a little more clear about what is happening here: Perl 5 tended to treat things as strings if you use them as strings, or as numbers if you use them as numbers. Perl 6 is more strict about that, but makes an exception for specifically numbers and strings; if you have noticed the class

Re: Is there a list out there of all the \n characters?

2017-03-06 Thread Brandon Allbery
On Mon, Mar 6, 2017 at 12:08 PM, Luca Ferrari wrote: > - \n\r (old mac) Pre-OS X used simply \r. not \n\r. -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com ballb...@sinenomine.net

Re: Is there a list out there of all the \n characters?

2017-03-06 Thread Brandon Allbery
On Mon, Mar 6, 2017 at 12:35 PM, H.Merijn Brand wrote: > But don't be surprised to see > > \r\r\n > And other weird stuff. There's at least one program out there where someone apparently used od on the output of a telnet session, saw an ancient hack for ancient teletypes

Re: program/script question

2017-03-07 Thread Brandon Allbery
On Tue, Mar 7, 2017 at 4:44 AM, Luca Ferrari wrote: > Usually a script is something that is not compiled, rather interpreted > on the fly (where "interpreted" could include any sort of JIT or alike > compilation). > This is one of those things where the ground has shifted

Re: embedded sub question

2017-03-04 Thread Brandon Allbery
On Sat, Mar 4, 2017 at 9:22 PM, ToddAndMargo wrote: > I am coming frrom Modula2 here. > > I M2 (using Perl syntax), > >sub A () { > sub B () { >}} > > B can only be seen inside A. Outside of A, B is > invisible. > > What are the rules for embedded subs in

Re: program/script question

2017-03-04 Thread Brandon Allbery
On Sat, Mar 4, 2017 at 10:23 PM, ToddAndMargo wrote: > This is one of those really dumb questions, but can I call > what I write in Perl a "program" or a "script"? Or, does > it even matter? > These days it doesn't really matter. The line was already significantly

Re: Net::SMTP attachments?

2017-03-01 Thread Brandon Allbery
On Tue, Feb 28, 2017 at 4:04 PM, ToddAndMargo wrote: > Anyone know how to do an attachment with Net::SMTP. Didn't you ask that a couple months ago, and I told you to look for a MIME module? I am starting to think that Net::SMTP and other low level modules need to be

Re: two questions: use 6, p5: package

2017-03-07 Thread Brandon Allbery
On Tue, Mar 7, 2017 at 3:12 AM, ToddAndMargo wrote: > 1) Looking at other code, I see this at the top a lot: > use v6; > > Mine have as the first line > #!/usr/bin/perl6 > > What is "use v6;" used for? > It ensures that perl 5 will choke if it

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

Re: String to array problem

2017-07-17 Thread Brandon Allbery
And this is another reason for the Grammar solution: it lets you do just what is needed, in a constrained environment so you don't have any risk (unless you do something questionable in the Grammar, but then that's on you.) On Mon, Jul 17, 2017 at 6:15 AM, Brent Laabs wrote:

Re: Net::SMTP raw, where is the username and password?

2017-07-10 Thread Brandon Allbery
On Mon, Jul 10, 2017 at 3:17 PM, ToddAndMargo wrote: > On 07/10/2017 06:48 AM, Timo Paulssen wrote: > >> It seems like you don't know the internals of the SMTP protocol. In that >> case, it's a bad idea to try to use the raw mode, when the simple mode >> is much simpler to

Re: processing misunderstand or bug?

2017-07-15 Thread Brandon Allbery
On Sat, Jul 15, 2017 at 6:50 AM, Gabor Szabo wrote: > If I run this in one terminal and run "ps axuw" in another terminal I > see 2 processes running. > If I press Ctrl-C in the terminal where I launched the program, both > processes are closed. > > OTOH If I run "kill PID"

Re: processing misunderstand or bug?

2017-07-15 Thread Brandon Allbery
On Sat, Jul 15, 2017 at 8:34 AM, Brandon Allbery <allber...@gmail.com> wrote: > Ctrl-C sends SIGINT to all processes in the terminal's foreground process > group. There is no concept of "current process" on a terminal; Unixlike > systems are multitasking, and all proce

Re: processing misunderstand or bug?

2017-07-15 Thread Brandon Allbery
On Sat, Jul 15, 2017 at 10:23 AM, Gabor Szabo wrote: > If I understand correctly, then this means Ctrl-C sends a SIGINT to > both the main process I ran and the child process I created using > Proc::Async. When I run kill -2 PID it only sends the SIGINT to the > process I

Re: zip mystery

2017-07-17 Thread Brandon Allbery
On Mon, Jul 17, 2017 at 8:18 PM, ToddAndMargo wrote: > But this does not: > > my $proc = run('zip', '-j', "$ZipLog", "$CimLog", "$LogFile", > "$DiagDir/*", :out); > > warning: name not matched: /opt/xxx/yyy/zzz/diags/* > > What am I doing wrong? > run() does not use a

Re: String to array problem

2017-07-16 Thread Brandon Allbery
On Sun, Jul 16, 2017 at 7:41 PM, ToddAndMargo wrote: > my $x='ls -al "Program Files" "Moe Curly Larry"'; > > Desired result: > my @y; >$y[0] = 'ls'; >$y[1] = '-la'; >$y[2] = 'Program Files'; >$y[3] = 'Moe Curly Larry'; > This was just discussed a few days

Re: String to array problem

2017-07-16 Thread Brandon Allbery
Nested quotes and escapes are handled by the Grammar-based solution I pointed to. You can't handle them in general with a simple regex. On Sun, Jul 16, 2017 at 8:54 PM, ToddAndMargo wrote: > > -Original Message- >> From: ToddAndMargo [mailto:toddandma...@zoho.com]

Re: Announce: Rakudo Star Release 2017.07

2017-07-25 Thread Brandon Allbery
On Tue, Jul 25, 2017 at 11:45 AM, Darren Duncan wrote: > However I assume it is the 3 bullet points that the release announcement > highlights: advanced macros, non-blocking I/O, bits of Synopsis 9 and 11. > The fact the announcement highlights these implies they are

Re: Fwd: Re: Is win 32 being worked on?

2017-07-25 Thread Brandon Allbery
On Tue, Jul 25, 2017 at 3:37 PM, Mark Carter wrote: > On 25/07/2017 20:31, Darren Duncan wrote: > >> I would question why any desktop computer manufacturers were still even >> shipping non-64-bit capable hardware in 2010. >> > I dual-boot (rarely) with it, and it runs

Re: Fwd: Re: Is win 32 being worked on?

2017-07-25 Thread Brandon Allbery
On Tue, Jul 25, 2017 at 5:41 PM, Darren Duncan wrote: > On 2017-07-25 2:08 PM, Steve Mynott wrote: > >> To clarify Rakudo itself *should* compile on 32 bit Windows systems >> (using either MSVC or mingw and maybe cygwin). >> >> The problem with Rakudo Star is that some

Re: Bi-directional communication with another process

2017-07-27 Thread Brandon Allbery
fc. > > Are we missing a working 'select' call? > - David > > On Fri, Jul 28, 2017 at 12:04 PM, Brandon Allbery <allber...@gmail.com> > wrote: > >> On Thu, Jul 27, 2017 at 7:49 PM, Norman Gaywood <ngayw...@gmail.com> >> wrote: >> >>>

Re: Help me be greedy!

2017-08-04 Thread Brandon Allbery
in control of myself (for the moment). >>> >>> 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 >>> >>>

Re: split and one liner problem

2017-08-04 Thread Brandon Allbery
That's a weird thing to do. You call a function that returns the lines of input as a list, in a context that joins them back together as words, and then try to split the result on lines again. lines already gives you what you want. Don't split. perl6 -e 'for lines { say "<$_>"; }' On Friday,

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

Re: split and one liner problem

2017-08-04 Thread Brandon Allbery
ailto:toddandma...@zoho.com>> wrote: > > > > Hi All, > > > > > > What am I doing wrong here? > > > > $ echo -e "abc\ndef\nghi" | perl6 -e 'for ( split "\n", lines ) { > > say "<$_>"; }' > &g

  1   2   3   4   >