Re: pint: Elizabeth, sort list???

2024-03-07 Thread Marc Chantreux
hello, > ==> sort({ | map { +$_ // $_ }, .split: /\d+/, :v }) ==> say() ok … so I'm lost but I'm not even curious to understand why (because of my lack of interest for the ==> operator :)) regards marc -- Marc Chantreux Pôle CESAR (Calcul et services avancés à la recherche) U

Re: pint: Elizabeth, sort list???

2024-03-07 Thread Marc Chantreux
tead is something closer than the haskell's $ operator with a very low priority so it could be possible to be parenthesis free. as example. I would like 1..10 ==> map * * 2 ==> say to be a joyful version of (1..10).map(* * 2).say regards -- Marc Chantreux Pôle CESAR (C

Re: pint: Elizabeth, sort list???

2024-03-05 Thread Marc Chantreux
ar64bang5bar abar64foo abar64foo4foo abar64foo4bar abar64foo14bar abar64foo5bar afoo13 afoo4 >.sort: { | map { +$_ // $_ }, .split: /\d+/, :v } The ouput seems to be ok. regards, -- Marc Chantreux Pôl

Re: who call raku?

2024-02-10 Thread Marc Chantreux
On Thu, Feb 08, 2024 at 02:25:00PM -0800, ToddAndMargo via perl6-users wrote: > Actually, I am looking for the name of the calling program: > Cobian, Task manager, deamon, etc.. linux centric anwser: raku -e 'say "/proc/{"/proc/$*PID/stat".IO.words[3]}/comm".IO.lines[0]

Re: steps of a path

2022-09-06 Thread Marc Chantreux
idoms. > Is that because it knows me, or has google started blessing Larry's > neologisms for the whole planet?!? ) Why not? new words happens all the time and those one are useful for programmers. -- Marc Chantreux Pôle de Calcul et Services Avancés à la Recherche (CESAR) http://annuaire.

Re: steps of a path

2022-09-05 Thread Marc Chantreux
I love this one. I used uniq and run so the whole script can be run from raku (except the xargs ls avoid the ARG_MAX error) <<. raku -e 'run < ls -lUd >, unique map {(.IO, *.parent …^ "/")>>.Str.Slip}, lines' /var/log/messages /var/log/auth.log regards -- Marc

Re: steps of a path

2022-09-05 Thread Marc Chantreux
of it. why made me realize I should take time between two post so I can have a fresh mindset for all of them! Actually: this is by far the simplest solution. Thanks. -- Marc Chantreux Pôle de Calcul et Services Avancés à la Recherche (CESAR) http://annuaire.unistra.fr/p/20200

Re: steps of a path

2022-09-05 Thread Marc Chantreux
teresting as it can provide a relative short solution with no advanced concept. I tried this line but got an immutability problem. I tried multiple work around with no success for the moment. <<. raku -e 'lines.IO.map: {repeat {.put} while not .=parent ~~ "/" }' /var/log/messages thank you

Re: steps of a path

2022-09-03 Thread Marc Chantreux
On Sat, Sep 03, 2022 at 09:50:08PM +0100, Ralph Mellor wrote: > > ( A B C ) to ((A) (A B) (A B C)) ? > [^1,^2,^3] I got that one and tried to generalize it with something more generic (using * to get the number of elements). thanks for helping -- Marc Chantreux Pôle de Calcul et

Re: steps of a path

2022-09-03 Thread Marc Chantreux
m:ex{^ [:r "/" <-[/]>+]+? }' /var/log/messages and it is pretty good compared to the sed version: <<. sed -E ':b p; s:/[^/]+$::; t b' thank you very much to both of you: I learned a lot on this post. -- Marc Chantreux Pôle de Calcul et Services Avancés à la Recherche (CESAR) http://annuaire.unistra.fr/p/20200

steps of a path

2022-09-03 Thread Marc Chantreux
og/messages" .split: "/" ]; .say for (^path).map( { path[0..$_].join: "/" } )[1..*]; I'm pretty sure I saw a very concise and elegant way to transform ( A B C ) to ((A) (A B) (A B C)) in the past but I'm enable to figure out how. Any help on that ? thanks by advance. -- Marc

Re: rotor in comb?

2022-08-28 Thread Marc Chantreux
}).flat.Bag.sort({-.value, .key})' "$@" raku -e ' lines.race.map({ |map ~*, .lc.match(:exhaustive, /(<[a..z]> ** 2)/) }).flat.Bag.sort({-.value, .key}).map: ' -- Marc Chantreux Pôle de Calcul et Services Avancés à la Recherche (CESAR) http://annuaire.unistra.fr/p/20200

rotor in comb?

2022-08-27 Thread Marc Chantreux
"$_ = $digraph{$_}" for sort { $digraph{$b} <=> $digraph{$a} } keys %digraph } $_=lc; while (/([a-z]{2})/g) {++$digraph{$1}; --pos; } ' Any help is very welcome. regards, -- Marc Chantreux Pôle de Calcul et Services Avancés à la Recherche (CESAR) http://annuaire.unistra.fr/p/20200

questions about sigpipe

2022-08-08 Thread Marc Chantreux
etail about it? Thanks for any answer and regards, PS: sigpipe is also a nice example of usage for INIT and NativeCall. -- Marc Chantreux Pôle de Calcul et Services Avancés à la Recherche (CESAR) http://annuaire.unistra.fr/p/20200

Re: something between run and qx() ?

2022-08-04 Thread Marc Chantreux
ub prefix:<`>(|c) is tighter(:<.>) { (run :out, c).out.lines } the `is tighter` thing was because I hoped I could write something like `.grep( / '.txt' $ / ).say Is is something to do to fix it ? Thanks everything you do on Raku! regards -- Marc Chantreux Pôle de Calcul et Services A

Re: something between run and qx() ?

2022-08-04 Thread Marc Chantreux
grep *.IO.f, map *.trim, `< dpkg-query -f ${db-fsys:Files} -W gnuplot* >; insead of my @installed-files = grep *.IO.f, map *.trim, ( run :out, < dpkg-query -f ${db-fsys:Files} -W gnuplot* > ).out.lines; regards,

Re: something between run and qx() ?

2022-08-04 Thread Marc Chantreux
Hi Brian and thanks for your reply. > There is the 'x' adverb for Q -- I think qx is equivalent to Q:x exactly. that's why Q:x doesn't help as it still run sh -c to execute the command. regards, -- Marc Chantreux Pôle de Calcul et Services Avancés à la Recherche (CESAR) h

Re: shorter way to set states in -n?

2022-07-03 Thread Marc Chantreux
hello, > Is this a bug, or are my (our?) expectations wrong? I posted on the list precisely because the doc. wasn't enough to GTD so I can't reply your question :) regards -- Marc Chantreux Direction du numérique de l'Université de Strasbourg Pôle de Calcul et Services Avancés à la Recher

Re: shorter way to set states in -n?

2022-07-02 Thread Marc Chantreux
say @o; ' works fine! thank you very much. -- Marc Chantreux Direction du numérique de l'Université de Strasbourg Pôle de Calcul et Services Avancés à la Recherche (CESAR) http://annuaire.unistra.fr/p/20200

shorter way to set states in -n?

2022-07-02 Thread Marc Chantreux
hello rakoons, AFAIK about raku -n, I need 2 lines to setup a state with a default value seq 2| raku -ne ' state (@o, @f); BEGIN @o = 0 xx 3; @o.push: "ok"; say @o; ' but is there a shorter way ? regards, marc

Re: probably worth a bug report ?

2022-01-02 Thread Marc Chantreux
Le Sun, Jan 02, 2022 at 12:32:46PM +0100, Elizabeth Mattijsen a écrit : > Maybe first explain why the error thanks for the explaination. especially > $ raku -e 'sub a(|c) { dd c }; a b => 42' > \(:b(42)) now my sub works the way I wanted: sub got (|c) { for c.hash.kv -> $rule

probably worth a bug report ?

2022-01-01 Thread Marc Chantreux
hello rakoons, I got this error message Too few positionals passed; expected 1 argument but got 0 in sub xxx at - line 1 in block at - line 2 Welcome to 퐑퐚퐤퐮퐝퐨™ v2021.09. Implementing the 퐑퐚퐤퐮™ programming language v6.d. Built on

shell to raku

2021-12-31 Thread Marc Chantreux
Le Fri, Dec 31, 2021 at 01:20:45PM +, Wesley Peng a écrit : > Replacing Bash scripts with Raku? That’s an interesting thing Well ... replacing bash is always a good thing but raku is not always the rhs of the substitution (could be dash/mksh/rc, make/mk, C, ...). raku is now my tool of

Last day for FOSDEM submission

2021-12-30 Thread Marc Chantreux
hello people, I just discovered this this morning: https://www.reddit.com/r/rakulang/comments/rrcp4c/steal_these_ideas_for_raku_fosdem_talks/ I don't remember if there was a previous annoucement in this list but it's still possible to jump in. I just submitted one on "Replacing Bash scripts

Re: the MAIN questions

2021-12-29 Thread Marc Chantreux
hello Daniel, > > Did i just dreamed about it ? > You sort of dreamed it. damn! thanks for the red pill. > my $argfiles = IO::ArgFiles.new(@files || '-'); my perl history works against me there: i see @files.elems || '-' here :) thank you. > The other change I'd suggest for additional

the MAIN questions

2021-12-29 Thread Marc Chantreux
hello rakoons, I have a script named fixlines which is basically sub fixline (Str $line) { ... } say fixline $_ for lines; This is far enough for personal usage but i would like to release it so i need a decent -h to be implemented and basically should look like Usage: fixlines [--test]

Re: is 'use v6' still a thing?

2021-12-29 Thread Marc Chantreux
realized it's not worth to spare it. thank you. regards marc -- Marc Chantreux Direction du numérique de l'Université de Strasbourg Pôle de Calcul et Services Avancés à la Recherche (CESAR) http://annuaire.unistra.fr/p/20200

is 'use v6' still a thing?

2021-12-28 Thread Marc Chantreux
hello people, long time ago, there was this 'use v6' line so perl should be v6 and still run v5.* things. I just took a look to https://raku.land/github:JJ/SDL2 and seen use v6; Does it still makes sense? Regards. -- Marc Chantreux Direction du numérique de l'Université de Strasbourg

Re: can't make from a S/// ?

2021-11-21 Thread Marc Chantreux
hello William, > #old: > rule TOP {* %% \n } > token line { * %% ',' } > #new: > rule TOP {* } > token line { * %% ',' \n } ohhh ... indeed! when i fixed the code on Ralph's instructions, i finally was able to slurp a whole file and discovered a emtpy entry at the end of the flow

Re: can't make from a S/// ?

2021-11-20 Thread Marc Chantreux
> On Sat, Nov 20, 2021 at 9:03 PM Marc Chantreux wrote: > > > > method col:sym ($/) { .make ~S:g/'""'/"/ } > > > That's not working for me. I'm on Moar (2021.06). > > works for me with: > > method col:sym ($_) { .make: ~S:g/'""'

Re: can't make from a S/// ?

2021-11-20 Thread Marc Chantreux
helllo William, > > Marc wrote: > > i'm inclined to think that this is easier to read: > > method col:sym ($/) { .make ~S:g/'""'/"/ } > That's not working for me. I'm on Moar (2021.06). works for me with: Welcome to 퐑퐚퐤퐮퐝퐨™ v2021.09. Implementing the 퐑퐚퐤퐮™ programming language v6.d.

Raku and Datasciences

2021-11-20 Thread Marc Chantreux
hello people, > I am still defending that we need a package for data > analysis/science/engineer (like the Perl5 PDL, Python Pandas or R > data.table) and an IDE for streaming programming like jupyter or rstudio. I'm still excited about this idea and my offer to test/feedback/document remains

Re: can't make from a S/// ?

2021-11-20 Thread Marc Chantreux
hello William, > method col:sym ($/) { make $/.subst(/'""'/, '"', :global).Str } which is just a longuest version of the line Ralph wrote. i'm inclined to think that this is easier to read: method col:sym ($/) { .make ~S:g/'""'/"/ } > The following line seems to work just fine,

why not raku ?

2021-11-19 Thread Marc Chantreux
hello, > I like ruby and perl so do I but raku is by far my prefered interpreted langage now. I don't raku that much and most of the time, i read the doc more than i actually write code but when it's writen, it's always elegant and concise the way i never seen before. > Maybe perl6 is still not

Re: can't make from a S/// ?

2021-11-19 Thread Marc Chantreux
hello Ralph, Thank you for the whole explaination and links. > method col:sym ($_) { .make: S:g/'""'/"/ } i dug around it but missed it! arggh ... > > am I right when i feel there is a way to do this > > substitution inside the grammar > As I've shown, yes. But it draws you into the `$/`

Re: fixing the documentation

2021-11-19 Thread Marc Chantreux
hello, Le Fri, Nov 19, 2021 at 07:12:13AM +0100, JJ Merelo a écrit : > Thanks a lot. well ... not sure who should thank someone here .. i meant: you spent so much more time on the raku ecosystem than i did ... thanks everyone.

can't make from a S/// ?

2021-11-18 Thread Marc Chantreux
hello rakoons, I want to be able to parse this: CSV.parse( '162,1,2,"Watt, Mrs. James (Elizabeth ""Bessie"" Inglis Milne)",female,40,0,0,C.A. 33595,15.75,,S', actions => CSV_as_table.new, ).made.say; I wrote this simple Grammar and action grammar CSV { rule TOP {* %% \n }

Re: fixing the documentation

2021-11-18 Thread Marc Chantreux
Hello, > The best would be if you propose a PR or open an issue at > https://github.com/Raku/doc. Any help with the documentation would > most certainly be appreciated as people working on the docs project > are overloaded. Sorry I was late on this because I wasn't sure how to revamp the whole

fixing the documentation

2021-08-25 Thread Marc Chantreux
hello people, D526P: https://docs.raku.org/language/5to6-nutshell#index-entry-PERL6LIB-PERL6LIB DFIM : https://docs.raku.org/language/modules#Finding_installed_modules DLIB : https://docs.raku.org/programs/03-environment-variables#index-entry-RAKULIB This D526P is deprecated and some RAKULIB

[better solution] pairs of separators from a string

2021-08-24 Thread Marc Chantreux
hello everyone, I made a mistake while replying to all of us so anwsers never reached your boxes. I'll summerize in one answer: Bill: > Is it just even/odd elements that you want to separate out? If so, maybe > .grep() is your friend here I don't think it is: 0, 2 ... * seems to be * closer

Re: pairs of separators from a string

2021-08-22 Thread Marc Chantreux
hello William, > your string, or whether-or-not some might be nested within each other. You > show a lone ampersand ("&") at the beginning of your example, but other > strings may not be so simple. really sorry about this artefact from previous attempts :( > > $string.comb(/ ( <:Ps> ~ <:Pe> .?)

[solved] pairs of separators from a string

2021-08-22 Thread Marc Chantreux
hello Yary, > and my instinct is that "map" is adding a layer you don't need or want for > this issue, should just be sending the results of comb to a block. But I > can't quite get the syntax right (and docs.raku.org seems down at the > moment) With this and what i understood from Vladim, i

(sigils are awesome, they say ...) Re: pairs of separators from a string

2021-08-22 Thread Marc Chantreux
thanks everyone for sharing, Vadim, my ($a, $b) = { @^a[0,2...Inf], @a[1,3...Inf] }.(q<(){}[]>.comb); say $a[0]; say $b[0] oh. i never see this direct call of a lambda before but it really makes sense! this is the answer i like the most. i rewrote it my way and this works my ($a, $b) = {

pairs of separators from a string

2021-08-21 Thread Marc Chantreux
hello, i would like to get the list of opening (α) and closing (ω) separators from this string: &""''(){}[] too many years of perl made me think about this solution or something alike but it didn't work. my (\α,\ω) =| map { .[0,2…∞], .[1,3…∞] }, q&""''(){}[]&.comb; fixing this is

Re: Notes/Questions about Leon Timmermans's talk

2021-06-10 Thread Marc Chantreux
Hello, > > sub foo ( Int $x ) { 0 if $x > 5 } > > sub hello {say "hello $^world"} > > if defined my $value = foo 45 { hello $value } >with foo 7 { say $^value } i feel really dumb right now as i just used with and didn't made the match in my head. > or if you want to trigger on *not*

Notes/Questions about Leon Timmermans's talk

2021-06-09 Thread Marc Chantreux
hello, I just saw this and it's very good https://www.youtube.com/watch?v=elalwvfmYgk The features he picked are indeed things i really like in raku and i learned some interesting details. Other details are still bugging me so i have some questions there: A. if x -> $y with // For exemple,

df.column1 ... stealing from others could be counter-productive?

2020-07-29 Thread Marc Chantreux
> > df.column1 ... return a list of values on this column > That thought should be a topic in its own right. what i really like in raku is that chance to not have all those fancy keywords just because langages lack of syntax so stealing from pandas, incanter, and others is a good idea only if we

Re: Baby steps to create a dataframe structure

2020-07-22 Thread Marc Chantreux
hello, On Tue, Jul 21, 2020 at 10:56:22PM -0300, Aureliano Guedes wrote: > Then, a native call to R may be better cus bring us dataframe an a lot of > statistical functions natively without other R's package. coming from perl/shell and having to use pandas a little bit, my current perception of

Re: vim-raku roadmap

2020-05-11 Thread Marc Chantreux
hello, > I think this got pulled into the Raku org so it didn't get lost - I > don't think anyone is "in charge" at the moment. I'll review the > existing PRs and apply them if possible. There was a public call to take over it some mounths ago. i haven't applied because i was affraid of the lack

Re: variable as subroutine?

2020-02-10 Thread Marc Chantreux
hello ToddAndMargo, > Can I declare a subroutine as a variable? just use the callable sigil (https://docs.perl6.org/type/Callable). those are 3 ways to write the same sub: sub foo ($x) { $x * $x } my = -> $x { $x * $x } my = * * *; regards, marc

rakudo.org outdated?

2020-01-03 Thread Marc Chantreux
hello people, i read an annoncement for rakudo 2019.11 and the last github release confirms that. so i started to update the guix package before discovering that the rakudo.org page still points to 2019.03. is there a problem with the last version or os rakudo.org just outdated? regards. marc

Re: play with raku and autobiographical numbers

2020-01-01 Thread Marc Chantreux
On Tue, Dec 31, 2019 at 03:16:50PM +0100, Tobias Boege wrote: > Here is my entry, having a Bag count the occurences of letters, > instead of the loop over @r you used. i'm not used to bags so i always forget it. i really love the your final code. thanks regards marc

play with raku and autobiographical numbers

2019-12-31 Thread Marc Chantreux
hello, 2020 describes itself as it is composed by 2 0 0 1 2 2 0 3 perfect golf excuse! I have : sub is_autobiographic (\x) { my \s = x.Str; my @r = s.comb; my %appearance_of; %appearance_of{$_}++ for @r; x ~~ join '',

(syntaxic choices) Re: split to walk into an HoH ?

2019-11-25 Thread Marc Chantreux
> I don't think so; just a stylistic choice well ... i tested ===> once because i'll choose any syntax that can spare me parenthesis especially in raku because i feel they are in the wrong place (scheme makes parenthesis right). Raku behaves better than perl in this regard because say (f

Re: split to walk into an HoH ?

2019-11-22 Thread Marc Chantreux
hello, > You could also use the feed operator is there a reason to do so? i see none. regards marc

Re: split to walk into an HoH ?

2019-11-22 Thread Marc Chantreux
hello, > Hi Marc, I tried the first solution you posted and the "subheaders" > are returned out of order (e.g. "2,1,3" and not "1,2,3"): you're right but it doesn't matter in this usecase. > mbook:~ homedir$ cat p6_chunk_csv.p6 > lines.classify(*.split(",").head(2)).pairs.map: { >

Re: split to walk into an HoH ?

2019-11-22 Thread Marc Chantreux
hello, > FWIW, I would make %section an HoA, which would be a less compact > structure in memory, but allows more succinct manipulation, like so: > my %section = lines() > .map( *.split(",") ) > .classify( { .[0] }, :as{ .[1] } ); > for %section.sort { > say .key;

Re: split to walk into an HoH ?

2019-11-22 Thread Marc Chantreux
hello Timo, > lines()>>.trim-leading.classify(*.split(",").head(2)); say to-json %foo' which led me to this solution: fix () perl6 -e ' lines.classify(*.split(",").head(2)).pairs.map: { .say for .key, |.value.map({ "\t" ~ .key }); } ' fix () perl6 -e '

Re: split to walk into an HoH ?

2019-11-22 Thread Marc Chantreux
hello Bruce, > The first key of each second level is missing, which differs from your sample > output above. > Have I corrupted your Awk code, or have I misunderstood something, or what? you just spotted a bug: the first subkey *is* indeed required. actually fixing the bug makes the awk version

Re: Fwd: split to walk into an HoH ?

2019-11-22 Thread Marc Chantreux
On Fri, Nov 22, 2019 at 06:20:51AM -0800, William Michels via perl6-users wrote: > Hi Marc, I did a search for 'semicolon' on the following page and > found the interesting text below. Semicolons are used to create > multidimensional lists, maybe that's what's going on in your code? indeed! i

Re: split to walk into an HoH ?

2019-11-22 Thread Marc Chantreux
> From a quick look through ``Perl6/Grammar.nqp`` and > ``Perl6/Actions.nqp``, I think that the semicolon is special-cased by > the compiler, so the slightly ugly way above (call the operator > directly) is probably the only way that works. *this* is the level of expertise i miss :) thanks for

Re: split to walk into an HoH ?

2019-11-22 Thread Marc Chantreux
hello, On Fri, Nov 22, 2019 at 03:07:28PM +0100, Patrick Spek via perl6-users wrote: > Could you post some input and expected output? That would make it > easier for me (and perhaps others) to see what exactly you're trying to > accomplish, in practical terms. sorry ... i'm so confortable with

split to walk into an HoH ?

2019-11-22 Thread Marc Chantreux
hello people, removing shell scripts is a good way to learn raku and compare. today i want to replace this: fix () { awk -F, '{print $1" "$2}' | sort -u | awk -F" " '{ if (seen == $1) print "\t"$2; else { seen = $1;

Re: anything faster than say [+] lines?

2019-09-28 Thread Marc Chantreux
hello, > should make it a bit faster, at the expense of *much* more memory > usage, as opposed to just. i was just reporting. perl6 isn't fast enough in this case to compare with other dynamic langages. > In any case, to get the same result, you could also do > > (0..10_000_00).sum.say >

Re: anything faster than say [+] lines?

2019-09-28 Thread Marc Chantreux
hello, > though that works here, admittedly, my p6 is sort old > This is Rakudo version 2018.03 built on MoarVM version 2018.03 > implementing Perl 6.c. this lead me test it with the docker rakudo-star (2019.03). time docker run rakudo-star bash -c 'seq 1| perl6 -e

Re: anything faster than say [+] lines?

2019-09-24 Thread Marc Chantreux
hello, > > > > nice ... but when x is ~ 75440 (not always), there is a problem > > > What is x here? > > sorry. x is the arg of seq (number of lines). > That never happens on my laptop well.. so it's a problem with my station. nevermind :) thanks again for helping marc

more unixish perl6?

2019-09-24 Thread Marc Chantreux
hello, i don't know if it's useful to feedback on it but i would like to share about MAIN. this is a very nice thing to have it built-in so the quality of your scripts can be improved without effort ($*USAGE is very nice!) but here are some parts i feel i miss. * dealing with $*ARGFILES should

Re: $*ARGFILES and MAIN

2019-09-24 Thread Marc Chantreux
On Mon, Sep 23, 2019 at 11:34:14PM -0500, Brad Gilbert wrote: > You can create your own $*ARGFILES. > > sub MAIN ( +@ARGS ){ > my $*ARGFILES = IO::ArgFiles.new( @ARGS || $*IN ); > .say for lines; > } the way i understand https://docs.perl6.org/language/variables, my dynamic

Re: anything faster than say [+] lines?

2019-09-23 Thread Marc Chantreux
hello Vittore, > 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 functions like slurp, lines, words already depends on $*ARGFILES (which is awesome, i think) so i have no doubt there will be

Re: anything faster than say [+] lines?

2019-09-23 Thread Marc Chantreux
hello liz and Vittore, > bypassing $*ARGFILES.lines by using $*IN.lines, makes it faster for me than > using slurp $*ARGFILES is the correct FH to use when it comes to write unix filters (as it was in the other examples of the page). > > say lines.map(*.Int).sum i recently read that >>

Re: $*ARGFILES and MAIN

2019-09-23 Thread Marc Chantreux
hello, > > multi sub MAIN ( :$c ) { say [+] lines>>.chars } > Isn't that just `slurp.chars` ? correct :) > > multi sub MAIN ( :$w ) { say [+] lines.map: +*.words } > Isn't that just `+words` ? Aren't you awesome ? At least you're right: the doc says: multi sub words ( IO::Handle:D $fh =

$*ARGFILES and MAIN

2019-09-23 Thread Marc Chantreux
hello people, short question: how to use $*ARGFILES in a MAIN function? context: as an exercice as well as demo, i reimplement unix filters (cat, grep, wc, join, paste, ...). Basic wc could be multi sub MAIN ( :$l ) { say +lines } multi sub MAIN ( :$c ) { say [+] lines>>.chars } multi

anything faster than say [+] lines?

2019-09-23 Thread Marc Chantreux
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/shell-command-to-sum-integers-one-per-line because: * the perl5 answer is fast compared to the other dynamic langages *

Re: flat a lazy gather ?

2019-08-10 Thread Marc Chantreux
hello Bruce, > Short answer: Add `flat` before `lazy in line 19, and remove `.flat` from > line 21. Like so: > my @future_aams = > flat lazy gather for 2019..∞ { take ._dates_of_year }; sure but i loose the ability to use @future_aams year by year. the best i i have here to keep

flat a lazy gather ?

2019-08-09 Thread Marc Chantreux
hello people, AÀM (Appel À Mousser) is the monthly social event of the Strasbourg(fr) LUG. the dates of those meetings are scheduled by an algorithm implemented in aam_dates_of_year (line 6). Now i would like to show 25 AAM dates staring from 2019-01. line 14 works fine but is too long. i really

Re: [golf?] list of matches

2019-07-10 Thread Marc Chantreux
hello Bruce; > # Elegant using the "cat-ears" range modifiers in Perl 6: > for 0 ..^ @players.end -> \i { > for i ^.. @players.end -> \j { > say @players[i,j].join(' vs '); > } > } > # See https://docs.perl6.org/type/Range i played around it and got: my @players = ; my

Re: documentation translation effort ?

2019-07-09 Thread Marc Chantreux
hello, On Tue, Jul 09, 2019 at 11:28:29PM +0200, Laurent Rosenfeld via perl6-users wrote: > I have updated the Wikipedia page linked in Marc's message. @Marc: please > check it and let me know if you see any remaining issues. reading the fix, i realized i mixed up the errors of the linuxfr page

Re: [golf?] list of matches

2019-07-09 Thread Marc Chantreux
On Tue, Jul 09, 2019 at 11:44:07PM +0200, Laurent Rosenfeld via perl6-users wrote: > You might want to take a look at the cross ("X") operator, which takes two > or more lists as arguments and returns a list or all lists that can be > constructed combining the elements of each list (or, in other

[golf?] list of matches

2019-07-09 Thread Marc Chantreux
hello people, i have a game where every opponent much play every other ones so i implemented vs to get a list of all the matches from a list of opponents. i'm pretty sure that there is a shorter/more beautiful solution than mine so i really would like to see. mine is sub vs (@xs ( $head,

Re: documentation translation effort ?

2019-07-09 Thread Marc Chantreux
hello, > There have been some efforts to translate perl6intro; but as Laurent says, > we can hardly say the documentation is complete, so diverting resources to > translation is probably not such a good idea. yeah. when laurent spoke about a moving target, i gave a look at the doc repo and there

Re: documentation translation effort ?

2019-07-09 Thread Marc Chantreux
hello Laurent, > the French Wikipedia page you refer to is not really wrong, but rather > terribly outdated and, therefore, no longer correct. I have a Wikipedia > account and can easily fix that page (using, if needed, the updated English > Wikipedia page on the same subject). The very first

documentation translation effort ?

2019-07-09 Thread Marc Chantreux
hello people, i just read this https://linuxfr.org/news/sortie-de-perl-5-30-0 in which the informations about perl6 are wrong. it points to https://fr.wikipedia.org/wiki/Rakudo_Perl which is wrong too and i was thinking that instead of writting wrong stuff on wrong sites, it would be nice to have

Re: replace s///r ?

2019-06-11 Thread Marc Chantreux
hello, On Tue, Jun 11, 2019 at 08:26:11AM -0500, Brad Gilbert wrote: > The /r modifier on s/// in Perl5 is S/// in Perl6. oops .. it was the section just after s/// :( thanks for pointing out. > Though you have to put it into a block lambda, otherwise it applies to > $_ before it gets a chance

replace s///r ?

2019-06-10 Thread Marc Chantreux
hello people, in perl5, i can print for map s/^/4/r, grep /^\d+$/, the perl6 version is a Seq, so much more memory friendly but i expected (and haven't found in the documentation) a short equivalent of s///r so the shorter i have is: $*ARGFILES

Re: (update the doc?) Re: run with $*OUT?

2019-06-06 Thread Marc Chantreux
hello, > Actually -- looks like it is there :-) though on the > Proc page, not the 'run' page -- too far from the expected lines. so maybe we should just add a link ? > I'm curious about whether you could rely > on a line being emitted right away -- e.g. > if there is some output-buffering of

(update the doc?) Re: run with $*OUT?

2019-06-06 Thread Marc Chantreux
> Something like this? > my $p = run 'cat', '-n', :in, :out; > $p.in.say($_) for ; > $p.in.close; > say $p.out.slurp; *that* simple!!! perfect ... thanks a lot! this isn't obvious to guess that '-' means "you can connect the subprocess directly to the perl interpreter".

run with $*OUT?

2019-06-06 Thread Marc Chantreux
hello people, French Perl Workshop is coming and would be a better event if *you* take part of it https://journeesperl.fr/jp2019/talks now the problem ... let's say i have a raku script to wrap mutt. in this script, i have * $body is the content of the body my message * $subject

Announce: french perl workshop (Aka Journées Perl)

2019-05-21 Thread Marc Chantreux
hello perl6 people, we hope there will be some events around the French Perl Worshop (aka journées perl) https://journeesperl.fr/jp2019/ there will be at least a "perl6 modules hackathon" (trying to contribute to the perl6 ecosystem). however i really would like to see a talk or a workshop

can't match unicode chars?

2018-07-31 Thread Marc Chantreux
hello people, given the slides of my talk in the slides.vim format (https://github.com/eiro/slides.vim), i want some of them to be shown one bullet a slide. so when i have this input: › Renater et le libre  Sympa  FileSender the desired output is: › Renater et le

Re: lats rakudo version from rakudobrew ?

2017-09-13 Thread Marc Chantreux
that.) i did it. i also removed all the repo and artefacts to start from scratch. yes i got a 2017.5. I have no more time to investigate so i fallback to my old script to make things work. thank you for helping -- Marc Chantreux (eiro on github and freenode) http://eiro.github.com/ http://eiro.gi

Re: takeWhile ?

2017-09-11 Thread Marc Chantreux
fore comparing to 2. and now i got it :) thank you for this regards -- Marc Chantreux (eiro on github and freenode) http://eiro.github.com/ http://eiro.github.com/atom.xml "Don't believe everything you read on the Internet" -- Abraham Lincoln

Re: takeWhile ?

2017-09-11 Thread Marc Chantreux
instead of (116, * * .6 ...^ * < 2 ).say the first expression is valid and i don't know what is does. the first expression is valid *and correct*. thank you! -- Marc Chantreux (eiro on github and freenode) http://eiro.github.com/ http://eiro.github.com/atom.xml "Don't belie

takeWhile ?

2017-09-11 Thread Marc Chantreux
ost there: (116, * * .6 ... * < 2 ).say but the first $_ < 2 remains in the list. the only one alternative i see is a gather/take loop but i really expect something shorter from perl6 :) any idea ? regards -- Marc Chantreux (eiro on github and freenode) http://eiro.github.

lats rakudo version from rakudobrew ?

2017-09-11 Thread Marc Chantreux
tually built stuff but at the end, perl6 -v still gives me 2017.05. any idea ? regards marc -- Marc Chantreux (eiro on github and freenode) http://eiro.github.com/ http://eiro.github.com/atom.xml "Don't believe everything you read on the Internet" -- Abraham Lincoln

sympa hackathon: perl6 for the IM part ?

2017-03-14 Thread Marc Chantreux
wants to help us, everyone is very welcome. just subcribe to this list: https://framalistes.org/sympa/info/sympa-20th-birthday-hackathon regards -- Marc Chantreux (eiro on github and freenode) http://eiro.github.com/ http://eiro.github.com/atom.xml "Don't believe everything you read on the Int

please apply to this CfP

2017-03-14 Thread Marc Chantreux
hello people, Polyconf comes to Paris in 2017: https://eventil.com/events/polyconf-17/submissions/new and I would be really important to have a perl6 primer there. Any volonteer ? regards -- Marc Chantreux (eiro on github and freenode) http://eiro.github.com/ http://eiro.github.com

lazy gather?

2017-03-13 Thread Marc Chantreux
({ abs golden - $_ }); which is not so appealing. then my programs starts to burn cpu and gets nothing. this is because it seems that gather isn't on demand so i moved the subscript [^1000]. this works but isn't intellectually right anymore. any idea to make it more appealing ? regards -- Marc Cha

Re: signature to preserve @*ARGFILES ?

2015-11-29 Thread Marc Chantreux
lem remains so i don't think this is about my code. sub MAIN (*@*ARGS,:$t) { say "$t" # .say for padded-cols $t, $*ARGFILES.lines.map: (*.split($t)) } i'm now running with This is perl6 version 2015.11 built on MoarVM version 2015.11 regards -- Marc Chantreux (eiro on

signature to preserve @*ARGFILES ?

2015-11-28 Thread Marc Chantreux
oogled, tried to read the doc and grep in roast but i found no way to do it. any idea to help me. so thanks thanks for reading and helping. regards -- Marc Chantreux (eiro on github and freenode) http://eiro.github.com/ http://eiro.github.com/atom.xml "Don't believe everything you re

Re: signature to preserve @*ARGFILES ?

2015-11-28 Thread Marc Chantreux
} } sub MAIN (*@*ARGS,:$t) { .say for padded-cols $t, $*ARGFILES.lines.map: (*.split($t)).eager; } -- Marc Chantreux (eiro on github and freenode) http://eiro.github.com/ http://eiro.github.com/atom.xml "Don't believe everything you read on the Internet" -- Abraham Lincoln

  1   2   >