Re: anything faster than say [+] lines?

2019-09-24 Thread Vittore Scolari
Thank you for the reply functions like slurp, lines, words already depends on $*ARGFILES (which > is awesome, i think) so i have no doubt there will be attention there. > Yes, that is a beautiful part of the specs. It is mimicking the Perl5/awk/sed semantics, without the magic. > > > nice ... b

Re: anything faster than say [+] lines?

2019-09-23 Thread Vittore Scolari
Thanks you too > $*ARGFILES is the correct FH to use when it comes to write unix filters > (as it was in the other examples of the page). > Ok, I am 100% sure that, if people use it, eventually $*ARGFILES will become as fast as $*IN. Because of people like Liz working on the project > nice ...

Re: anything faster than say [+] lines?

2019-09-23 Thread Vittore Scolari
Hi Liz, bypassing $*ARGFILES.lines by using $*IN.lines, makes it faster for me than using slurp, and seems like a more logic algorithm to solve the problem. I think that, for any person that seriously thinks about using perl6 for one-liners, using $*IN instead of $*ARGFILES is something to take int

Re: anything faster than say [+] lines?

2019-09-23 Thread Vittore Scolari
say [+] $*IN.lines>>.Int is quite faster. On Mon, Sep 23, 2019 at 7:58 PM Marc Chantreux wrote: > hello, > > question: in raku, is there a faster solution than > > say [+] lines > > long story; > > here is a thread i would like to reply to > > > https://stackoverflow.com/questions/450799/shel

Re: nativecall and variable argument lists

2019-08-29 Thread Vittore Scolari
w(params => (   Other parameters before   Parameter.new(   type => Callable,   sub-signature => &callback.signature),   ... Other parameters after   ), returns => int32);   }     ... like pera-int-f after } From: Vittore Sco

Re: nativecall and variable argument lists

2019-08-29 Thread Vittore Scolari
Hello, Thanks to the amazing job Lizmat did to implement runtime signatures it can be done. You could also probably add some caching of the signatures and the functions. I didn’t benchmark. Here the code: use NativeCall; sub pera-int-f(Str $format, *@args) {     state $ptr = cglob

Re: Perl6 use cases

2018-11-05 Thread Vittore Scolari
Hi, whenever I want to have fun, and I need to parse a non-trivial file format, dealing with the output of special purpose software performing analysis on experimental data, I choose Perl 6 due to the fact that composability makes grammars very readable and logical-looking. On the other end, I sti

Re: What are the official names?

2018-10-03 Thread Vittore Scolari
To simplify, it is my understanding that the "Apocalypse 6: Subroutines" document define that as a subroutine declaration, with signature. Forgetting the nomenclature, that might well be inspired by magical imaginary, AFAIK, it is practically just pattern matching, same as a regex: to teach the

Re: Using HashBags

2018-04-08 Thread Vittore Scolari
I answer myself: with % you get an Hash On Sun, Apr 8, 2018 at 5:53 PM, Vittore Scolari wrote: > Wouldn't here be better to use the % sigil? > > my %docents = bag @rows.map: -> @row {@row[0] xx @row[1]}; > > > > On Sat, Apr 7, 2018 at 1:02 PM, Fernando Santagata

Re: Using HashBags

2018-04-08 Thread Vittore Scolari
Wouldn't here be better to use the % sigil? my %docents = bag @rows.map: -> @row {@row[0] xx @row[1]}; On Sat, Apr 7, 2018 at 1:02 PM, Fernando Santagata < nando.santag...@gmail.com> wrote: > Hi, > > I'm not sure that I've understood what you need. > If you get that array of arrays from a anoth

Re: %% with zero denominator

2017-12-11 Thread Vittore Scolari
(interrupt 0) On Mon, Dec 11, 2017 at 11:04 PM, Vittore Scolari wrote: > not what you think: > > module operator in % in perl6 is defined as $b - $a * floor($b / $a) > > > On Mon, Dec 11, 2017 at 10:37 PM, Sean McAfee wrote: > >> On Mon, Dec 11, 2017 at 12:56 PM, Darren Dunca

Re: %% with zero denominator

2017-12-11 Thread Vittore Scolari
not what you think: module operator in % in perl6 is defined as $b - $a * floor($b / $a) On Mon, Dec 11, 2017 at 10:37 PM, Sean McAfee wrote: > On Mon, Dec 11, 2017 at 12:56 PM, Darren Duncan > wrote: > >> On 2017-12-11 12:22 PM, Sean McAfee wrote: >> >>> Well, not really. I don't think x %%

Re: %% with zero denominator

2017-12-11 Thread Vittore Scolari
I think that this stems from a confusion between the divisibility problem in integer number (on a ring) and the divisibility problem resolved by the perl6 %% operator. Personally I think that %% is useless while the former is useful and missing. But I have nothing against useless operators On Mon