Re: Perl6 and wxwidgets

2014-06-08 Thread Brandon Allbery
On Sun, Jun 8, 2014 at 6:54 AM, Erik Colson 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 famously diffi

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 wrote: > I expected this output: > website > ForeignAssistance > ForeignAssistanceRow > AssistanceType > RecipientCountry > ProgramName > > but the output was: > > └website┐ > > └ForeignAssistance┐ > > └ForeignAssistanceRow┐ > $/[0] is a Match object, wh

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 wrote: > On Fri, 13 Mar 2015 07:13:31 -0500 > Tom Browder 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 'v6' superflous giv

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 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 scope there (I don'

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 wrote: > On Mar 19, 2015 8:58 PM, "Brandon Allbery" wrote: > > On Thu, Mar 19, 2015 at 9:32 PM, Tom Browder > wrote: > >> > >> if (self.$elem) { # <=== LINE 995 === LINE 995 > >

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 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 some reason, you use

Re: help installing Inline::Perl5

2015-06-07 Thread Brandon Allbery
On Sun, Jun 7, 2015 at 7:43 PM, RB 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 allber...@gmail.com

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 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 files that can be s

Re: Sub args: choose one of two?

2015-07-02 Thread Brandon Allbery
On Thu, Jul 2, 2015 at 3:08 PM, Tom Browder 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. -- brandon s al

Re: Passing a hash to a subroutine: best method?

2015-07-03 Thread Brandon Allbery
On Fri, Jul 3, 2015 at 11:26 AM, Tom Browder wrote: > # method 1 > my %hash1; > foo1(%hash1); > say %hash1.perl; > sub foo1(%hash) { > %hash{1} = 0; > } > This is what I would naïvely expect to work in any language except Perl 5. > # method 2 > my %hash2; > my $href2 = %hash2; > foo2($href2)

Re: String trim method

2015-08-05 Thread Brandon Allbery
On Wed, Aug 5, 2015 at 6:47 PM, Tom Browder 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 something like

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 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 'trim-rw' not? It seem

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 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 ‘-M strict

Re: Bug or PEBCAK?

2015-12-31 Thread Brandon Allbery
On Thu, Dec 31, 2015 at 8:55 AM, Parrot Raiser <1parr...@gmail.com> wrote: > > I'm not sure how to classify this one. It never occurred to me that a > new Linux installation would NOT include a C compiler. Installing gcc > fixed that. Normal for Debianoids. "sudo apt-get install build-essential

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 anythi

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 mention ancient) throughou

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 to install the modul

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 kf8nh

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 > the case of a filena

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 kf8nh

Re: Confused about rakudobrew and Rakudo Star

2016-02-03 Thread Brandon Allbery
On Wed, Feb 3, 2016 at 10:30 PM, James E Keenan wrote: > I am evidently confused as to the relationship, if any, between the > 'rakudobrew' utility and the Rakudo::Star distribution. In short: rakudobrew is for the folks who want to track the rapid development of Rakudo. Star is for folks who w

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 HEAD will be working toward a v6

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 want Nil there; it's not

Re: 'split': differences between Perl5 and Perl6

2016-02-27 Thread Brandon Allbery
On Sat, Feb 27, 2016 at 8:34 PM, James E Keenan wrote: > I'm surprised to get exactly the same output I got in both languages when > my delimiter was the multi-character string 'tri'. The '[' and ']' > characters do not seem to indicate "character class" at all. It's as if > '/[...]/' magically

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 change the code- which

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 valid letter in the Greek al

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 wrote: > On 2016-04-12 6:59 AM, Brandon Allbery wrote: > >> 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 >&g

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 definition aborts c

Re: testing with a "warn"

2016-04-29 Thread Brandon Allbery
On Fri, Apr 29, 2016 at 3:44 PM, Timo Paulssen wrote: > I didn't actually read the other mail in this thread yet, but you can > catch a control exception (like warn uses) with a CONTROL block. Don't > forget to .resume the exception unless you want it to break out of your > code, too. > Oh, they

Re: testing with a "warn"

2016-04-29 Thread Brandon Allbery
On Fri, Apr 29, 2016 at 3:47 PM, Brandon Allbery 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 decides it should be i

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 allbery kf8nh

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 bit vectors are bot

Re: select (3)

2016-04-30 Thread Brandon Allbery
On Sat, Apr 30, 2016 at 11:06 AM, Kaare Rasmussen wrote: > Shouldn't this be a C style array with two bytes, 0 and 2, or > 0010 ? I'm not sure; it's not documented :/ Also not sure offhand how endianness plays in to select()'s bit vectors if you build them by hand. Which leads to...

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, as I understand it

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

2016-04-30 Thread Brandon Allbery
On Sat, Apr 30, 2016 at 7:49 PM, Brandon Allbery wrote: > 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 >

Re: Fwd: perl6 INC

2016-05-11 Thread Brandon Allbery
On Wed, May 11, 2016 at 10:21 AM, Bennett Todd wrote: > Zef seems to have left files containing the string Readline in > share/perl6/site, plus .perl6/precomp. The filenames are hashes, perhaps > from a git clone that zef used to pull Readline? They're from rakudo's CompUnitRepo, which has to d

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 using a separate dat

Re: How to capture an div 0 exception

2016-05-18 Thread Brandon Allbery
On Wed, May 18, 2016 at 11:27 AM, mt1957 wrote: > This has something to do with lazy evaluation. It triggers the calculation > when it wants to show the value in $r. IIRC it doesn't throw, it returns a Failure (deferred/lazy exception that throws when accessed). -- brandon s allbery kf8nh

Re: How to capture an div 0 exception

2016-05-18 Thread Brandon Allbery
On Wed, May 18, 2016 at 11:29 AM, Brandon Allbery wrote: > On Wed, May 18, 2016 at 11:27 AM, mt1957 wrote: > >> This has something to do with lazy evaluation. It triggers the >> calculation when it wants to show the value in $r. > > > IIRC it doesn't throw, it

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 about

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: "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 benefit of with's defined check? Seem

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? > "$name".(); # gives me "No such

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 sine nomine

Re: subset problem

2016-09-16 Thread Brandon Allbery
On Fri, Sep 16, 2016 at 5:04 PM, yary wrote: > Having (elem) return False when the value of a Map element is 0 confuses > me. Me too, I disliked it the moment you pointed it out. I think that behavior is intended for Bags, I am not sure it has any business being in Sets. -- brandon s allbery

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 invocation; they went to stdout

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 have googled but no good

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 the Xcode 7 Command L

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 sine nomine associate

Re: perl 5?

2016-11-17 Thread Brandon Allbery
On Thu, Nov 17, 2016 at 3:03 PM, ToddAndMargo wrote: > And quiet a few perl 5 programmers are REALLY GRUMPY/CRABBY > about perl 6. I don't get it. > I think mostly this is history: the original perl 6 development team languished for many years producing basically nothing while promising everyth

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? > > rakudo-star-0.0.201

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 it by default. `yum inst

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 sine nomine as

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 making it work in native

Re: zenity sub

2016-12-01 Thread Brandon Allbery
On Thu, Dec 1, 2016 at 2:45 PM, Brandon Allbery 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 at least makes avail

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 array (which will be pass

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 sine no

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. > > LL > > On Thu, Jan 1

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 ba

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 error message). This is a

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 kf8nh

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 list. Which is why they

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 you reported earlier. --

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 your machine, and in pass

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 tests. One would expect

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 allber...@gmail.com

Re: inline question

2017-01-17 Thread Brandon Allbery
Inline::Perl5 loads Perl 5 with hooks, so yes, it must be installed. On Tue, Jan 17, 2017 at 12:35 PM, ToddAndMargo wrote: > Hi All, > > Does Perl 5 have to be installed to get Inline work? Or just a path > to the downloaded perl5 module(s)? > > Many thanks, > -T > > -- > ~~

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 highlighting, so there is

Re: smtp question

2017-02-09 Thread Brandon Allbery
On Thu, Feb 9, 2017 at 11:41 PM, ToddAndMargo wrote: > I am looking at > https://github.com/retupmoca/P6-Net-SMTP > > I pretty much understand everything, but > >- > >send($from, $to, $message, :$keep-going) > >Sends an email $message (which can be a Str or something with a Str >m

Re: smtp question

2017-02-10 Thread Brandon Allbery
If this were Haskell it'd be ByteString. But it's Perl 6 and byte arrays are too much of a PITA at present, since you can't do string-y things with them sensibly. On Fri, Feb 10, 2017 at 4:23 AM, Francesco Rivetti wrote: > On 2017-02-10 5:51 AM, Brandon Allbery wrote: > &

Re: per 5 converter?

2017-02-12 Thread Brandon Allbery
On Sun, Feb 12, 2017 at 7:48 PM, ToddAndMargo wrote: > The case is, if I can't figure out the syntax in Perl 6, white a > quickie in Perl 5, translate it and see what I did wrong. > Translators are infamous for producing gobbledygook no self-respecting programmer would write -- brandon s a

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 gist"). For value types, it wi

Re: reverse of .lines?

2017-02-17 Thread Brandon Allbery
On Fri, Feb 17, 2017 at 10:26 PM, yary wrote: > On Fri, Feb 17, 2017 at 9:52 PM, ToddAndMargo > wrote: > >> @Lines = $StringFullOfLineFeeds.lines > > > @Lines = $StringFullOfLineFeeds.lines.reverse They want what Haskell calls unlines, not a reversed list of lines. I would presume some variant

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 and translate them >

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 likely to generate inco

Re: Where is "Subject"?

2017-02-24 Thread Brandon Allbery
On Fri, Feb 24, 2017 at 2:50 AM, Luca Ferrari wrote: > On Fri, Feb 24, 2017 at 7:51 AM, ToddAndMargo > wrote: > > Am I blind or is there nowhere to set the subject of an eMail > > in Net::SMTP? > > I suspect it is implementing a quite low-level interface: smtp does > not know anything about a su

Re: Your thoughts on Padre?

2017-02-24 Thread Brandon Allbery
On Fri, Feb 24, 2017 at 5:45 PM, ToddAndMargo wrote: > http://padre.perlide.org/ > > Any good for Perl 6? You have a better one you like? Padre's maintained? I thought it died years ago. -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com

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 "color" from the module "Termi

Re: Terminal::ANSIColor problem

2017-02-26 Thread Brandon Allbery
On Sun, Feb 26, 2017 at 9:38 PM, ToddAndMargo wrote: > On 02/26/2017 06:02 PM, Brandon Allbery wrote: >> >> On Sun, Feb 26, 2017 at 8:14 PM, ToddAndMargo > <mailto:toddandma...@zoho.com>> wrote: >> >> Speaking of syntax errors, what is wrong with thes

Re: Your thoughts on Padre?

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

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, with the result that up

Re: Terminal::ANSIColor problem

2017-02-28 Thread Brandon Allbery
On Tue, Feb 28, 2017 at 3:46 PM, ToddAndMargo wrote: > On 02/28/2017 04:11 AM, yary wrote: > >> >> On Tue, Feb 28, 2017 at 12:53 AM, ToddAndMargo > > wrote: >> >> sub PrintRed ( $Str ) { print color('bold'), color('red'), >> "$Str", color('reset'); } >>

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 buried somehow; people tend

Re: Net::SMTP attachments?

2017-03-01 Thread Brandon Allbery
That's why I said "bury". The basic problem here is a conflict between a mindset that builds stuff up from smaller parts, and the needs of people who need to use the higher level stuff. Building up from components is good for many reasons. But people who want to buy a car don't expect to be handed

Re: Net::SMTP attachments?

2017-03-01 Thread Brandon Allbery
y use case, leaving out the pieces-parts. On Wed, Mar 1, 2017 at 5:47 PM, Brandon Allbery wrote: > That's why I said "bury". > > The basic problem here is a conflict between a mindset that builds stuff > up from smaller parts, and the needs of people who need to use the h

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 Perl 6? > subs default to

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 blurred in the 90s, and by now

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 unix, openafs, kerberos, inf

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 involving a NUL, and t

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 enough to make the dist

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 gets asked to load the file

Re: How do I call system functions?

2017-03-08 Thread Brandon Allbery
On Wed, Mar 8, 2017 at 5:51 AM, ToddAndMargo wrote: > int XStoreBytes(Display *display, char *bytes, int nbytes); Do I want to know why you're using X11R3 compatibility functions? -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com

Re: How do I call system functions?

2017-03-08 Thread Brandon Allbery
On Wed, Mar 8, 2017 at 1:00 PM, ToddAndMargo wrote: > On 03/08/2017 07:49 AM, Brandon Allbery wrote: > >> >> On Wed, Mar 8, 2017 at 5:51 AM, ToddAndMargo > <mailto:toddandma...@zoho.com>> wrote: >> >> int XStoreBytes(Display *display, char *bytes, i

Re: How do I call system functions?

2017-03-08 Thread Brandon Allbery
On Wed, Mar 8, 2017 at 1:23 PM, ToddAndMargo wrote: > > class Display is repr('CStruct') {} > > > Class Display has no attributes, which is illegal with > the CStruct representation. > > What in the world? > It's an opaque pointer; CStruct is the wrong representation to use. Try CPoint

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 () { #`(Sub|63218616

Re: Need help with a match

2017-03-13 Thread Brandon Allbery
want one 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 wrote: > Yo

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: 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 comparing perl 5 speed to perl 6

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 of the Perl 5 "or"

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 perl (e.g. unless), and

  1   2   3   4   >