Flycheck-raku module for MELPA

2020-05-27 Thread Xin Cheng
Hi I am an emacs user, and I just installed the raku-mode for emacs. It is also advertised there is a flycheck-raku module on MELPA. But there is no such module. Instead, there is a flycheck-perl6 module. It seems the author would like people to switch from perl6-mode to raku-mode, from flychec

Re: IO ???

2018-06-16 Thread Xin Cheng
Thank you all for answering! Regards Ziping > On Jun 16, 2018, at 1:13 PM, Elizabeth Mattijsen wrote: > >> On 16 Jun 2018, at 10:59, Xin Cheng wrote: >> I am wondering why the IO::Path class doesn't have a "close" method. After I >> read from a fil

Re: IO ???

2018-06-16 Thread Xin Cheng
I am wondering why the IO::Path class doesn't have a "close" method. After I read from a file by $filename.IO.lines -> $line; Am I supposed to close the file, or it is automatically closed for me after the reading? I tried something like $filename.IO.close; It is a runtime error. It seems to

Re: How do I remove leading zeros?

2018-06-13 Thread Xin Cheng
Now we know the meaning of >> and <<. But what about <( and )> ? What do they mean here? Thanks. Xin > On Jun 13, 2018, at 2:18 PM, Brad Gilbert wrote: > > On Wed, Jun 13, 2018 at 1:09 PM ToddAndMargo > wrote: >> >> On 06/13/2018 11:06 AM, ToddAndMargo wrote: >>

Re: need sort help

2018-06-09 Thread Xin Cheng
In "say sort:" it's not used as a > method, it's used as a sub; the colon causes it to try to reinterpret as a > method call, then it can't find an invocant for the method to operate on. > > In "@x .= sort:", the ".=" forces a method call w

Re: need sort help

2018-06-09 Thread Xin Cheng
the > left as invocant, and assign the result back to the thing on the left. So > > @x .= sort: ... > > is the same as > > @x = @x.sort(...) > > So you're being confused by the syntactic "magic" of ".=". > > On Sat, Ju

Re: need sort help

2018-06-09 Thread Xin Cheng
logs). Which > means some or all of those variables will be undefined instead of numbers. > The // replaces those with the following value (0), so they do something > sensible when sorted instead of producing warnings. > > On Sat, Jun 9, 2018 at 11:40 AM Xin Cheng <mailto:x

Re: need sort help

2018-06-09 Thread Xin Cheng
This is very interesting. But I wonder how it works. I can understand the first line my ($month, $day, $year, $hour, $minute, $second) = .comb(/\d+/); Which extract the variables from $_. What is the second line doing, it is very concise. ($year // 0, $month // 0, $day // 0, $hour // 0, $min

Re: How to print colorized text to the terminal

2018-06-04 Thread Xin Cheng
Thanks Bruce, This is great, and It works as I expected. I appreciate all the helps. Regards Xin > On Jun 4, 2018, at 9:04 AM, Bruce Gray wrote: > > >> On Jun 3, 2018, at 7:41 PM, Xin Cheng wrote: >> >> I am trying to make a program to do grep with perl6 re

Re: How to print colorized text to the terminal

2018-06-03 Thread Xin Cheng
I just tried to use "put" in place of "say", and got the same result. Thanks. Ziping > On Jun 3, 2018, at 8:44 PM, Brandon Allbery wrote: > > "say" uses the .gist method, which quotes the output for readability. You > probably want "put" in

How to print colorized text to the terminal

2018-06-03 Thread Xin Cheng
Hi, I am trying to make a program to do grep with perl6 regular expression, and I would like to colorize the matched part to the terminal. So the following is what I wrote sub MAIN(Str $pattern,Str $filename){ for $filename.IO.lines -> $line { my Str $temp = $line; if $tem

Re: What is my sub?

2018-05-26 Thread Xin Cheng
Hi, Why does anyone want to know the name of the sub inside the sub itself? Is it more interesting to know the name of the calling sub? Thanks! Xin > On May 26, 2018, at 2:32 PM, Larry Wall wrote: > > On Fri, May 25, 2018 at 07:23:45PM -0700, ToddAndMargo wrote: > : Follow up: based on Yary