🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
notagoodidea (I will install hunspell before you finish to read the draft, way too much typos that lizmat and you found :/) 00:01
MasterDuke "Roles acts and describes an object’s behavior.", not sure what you're saying here. you could drop 'acts and' to just have "Roles describe an object’s behavior.", but that may change the meaning too much
don't know if hunspell would catch those, they aren't really misspelled words 00:02
"you manages behavior", typo there, should drop the 's' on 'manages'
notagoodidea MasterDuke: "Roles descibes and acts on an object's behaviour" seems to convey the meaning intended. 00:03
MasterDuke grammatically it's not quite right 00:04
notagoodidea minus the two "s" for the verbs.
MasterDuke "Roles describe and implement an object's behavior"? or do you really mean that the object's behavior itself is what the roles act on? because then yeah, drop the two 's's and it's good 00:05
"Raku have actually" i would use 'has' 00:06
"Let’s create a Set will you?" is kind of mixing up "us" and "you". maybe "Let’s create a Set shall we?" 00:07
"resulted on this" -> 'in'
tonyo notagoodidea: the rule for an vs a in english is if the next word begins with a vowel use `an`. if the next word is an acronym that, when the first letter of the acronym is spelled with a vowel, you can use either a or an, eg `a FDA decision` and `an FDA decision` are both correct 00:08
MasterDuke "i only have see the is trait used" -> "I only have seen the is trait used"
i think it's more precise to say if the next word begins with a vowel sound 00:09
e.g., "an hour" 00:10
notagoodidea tonyo: Sometimes the writing reflex from French catch up and I finish writing "an" because thinking "un" and my fingers follows the flow.
tonyo an ATE is wrong if the acronym is said like the word rather than spelled
MasterDuke "will accepts" extra 's'
SQL is a tricky one because people pronounce it both with a leading vowel sound and not. 'ess-q-ell' and 'sequel' 00:13
sortiz notagoodidea: In your %set1 and %set2 examples, you are creating a Set but raku convert them to Hash at assign time. (The "default" implies an "is Hash") 00:13
notagoodidea So the type of the container will be an Hash instead of a Set? 00:14
sortiz Yes. See:
notagoodidea m: my %hash = set <a b c>; say %Hash.WHAT;
evalable6 (exit code 1) 04===SORRY!04=== Er… 00:15
notagoodidea, Full output: gist.github.com/419b5797dc848ddfc1...d05dfd149d
notagoodidea m: my %hash = set <a b c>; say %hash.WHAT;
evalable6 (Hash)
notagoodidea m: my $set = set <a b c>; say $set.WHAT; 00:16
evalable6 (Set)
MasterDuke "But the very idea around this lead me to this ideas of all those moving pieces" some mismatched quantities here. maybe "But the very idea around this leads me to this idea of all those moving pieces", but that's a little awkward with the duplicated "idea". maybe "But the very concept around this leads me to this idea of all those moving pieces"?
"tree how lousy", 'of' instead of 'how' 00:17
notagoodidea sortiz: I have added the comment about %set{1,2} not being Set, thanks. 00:18
sortiz m: my @list is List = 1,2,3,4; my @arr is Array = 1,2,3,4; say @list.WHAT, @arr.WHAT;
evalable6 (List)(Array)
MasterDuke "If they acts", not 100% sure what you mean, but the trailing 's' should be dropped 00:19
"Classes are on how you identify yourself where Roles are on how you act." should remove both 'on'
sortiz The same applies to Positionals, the default "is Array"
m: my @b is Buf = 10,20,30; say @b.WHAT, @b; 00:22
evalable6 (Buf)Buf:0x<0A 14 1E>
notagoodidea sortiz: yes that's a part of the point I was trying to make but I got caught by it due to $ vs %.
MasterDuke there are a couple things in the last two paragraphs, but i gotta get to bed. good overall, mostly just minor typos 00:23
notagoodidea Thanks a lot for catching all those typos already MasterDuke! 00:24
sortiz 'night MasterDuke 00:25
sortiz notagoodidea: BTW, those defaults applies to "variables", for "constants" @ the default is List and for % is Map 00:29
m: constant %m = foo => 1, bar => 3; dd %m
evalable6 Map.new((:bar(3),:foo(1)))
RaycatWhoDat Is there a way to redo a prompt without loop? 01:14
Is there something like my $answer = prompt "..."; redo when X::TypeCheck; or something? 01:16
sortiz RaycatWhoDat: Try with something like "my $a; repeat { $a = prompt "Num: " } until +$a !~~ Failure;" 01:27
RaycatWhoDat Hmm. 01:33
Okay, I dig it. The + puts it into Numeric context?
sortiz Yes.
RaycatWhoDat Is there a way to call a subset instead? 01:42
sortiz Sure. ~~ can match (check for) your subset. 01:43
RaycatWhoDat gist.github.com/RayMPerry/61f7a2ef...3ce147e984 01:46
So, this currently doesn't work but I hope this will clarify what I'm trying to do.
Putting the subset on the right-hand side just causes "use of uninitialized value" errors 01:47
sortiz Try: subset DollarAmount of Cool where /^ <[0 .. 9\.]>+ $/; my $a; repeat { $a = prompt "Num: " } until $a ~~ DollarAmount; 01:51
RaycatWhoDat Use of uninitialized value errors. 01:52
"type Any in numeric context" 01:53
wait 01:55
I'm stupid
One should save their document before retrying.
So, Whatever-star was being used incorrectly?
sortiz I commented your gist. 02:03
notagoodidea sortiz: The variation between the "variables" and "constant" are due to.. compile-time efficiency? 02:05
RaycatWhoDat Thank you, sortiz 02:06
sortiz notagoodidea: In part, but as "constants" defaults to immutable objects.
notagoodidea m: constant &talk = &say; say &talk.WHAT;
evalable6 (Sub)
notagoodidea m: my &talk = &say; say &say.WHAT;
evalable6 (Sub)
notagoodidea sortiz: It is logic but surprising and don't seem to be clearly noted in the documentation. 02:10
elcaro m: my &yell := &say ∘ *.uc; yell 'hello' 02:12
evalable6 HELLO
sortiz Indeed. In the "variable" case, the user does not need to use { } nor [ ] to create Hash or Array. In fact _should not_, to avoid extra work at compile time. 02:13
notagoodidea I have the idea to avoid "$" as possible for other than scalar but I am not sure it is doable. 02:15
sortiz Depends, $ also results in "itemization", that you may need or not :-) 02:18
notagoodidea yep, but for itemazition, it is seem the right sigil as it represent one item. It mostly to avoid my $foo = set <a b c>; 02:21
Even if there is no type constraint on $, it is expected that it will hold an item and not a associative. 02:22
k way to late here, 'night all o/ thanks sortiz for new knowledge! 02:24
PimDaniel \o 09:31
tyil o/
PimDaniel Bonjour, ça va! ;)
May an infix (+) sub|method have more than 2 elements , i need a list, is it possible? Thank's! 09:33
tyil what would you want the + to do when it's given a list? 09:34
PimDaniel Sum each elements.
tyil m: say [+] (1, 2, 3)
evalable6 6
tyil PimDaniel: like this?
PimDaniel And why couldn't it be called $obj_sum = $obj1 + $obj2 + $obj3, + ... 09:36
tyil m: say 1 + 2 + 3
evalable6 6
tyil this works fine too
but you're not giving it a list in that example
`[op] @list` is just a way to practically put `op` between each element of `@list` 09:37
PimDaniel hummm, ok i see!
ok but if i call [+] (obj1,obj2,$objn,...) should the called sub look like this : sub infix<+>(Obj @lst) { ??? 09:41
May be i need to give a try...? 09:42
tyil PimDaniel: en.wikibooks.org/wiki/Raku_Program..._Operators 09:45
>The [ ] square brackets turn any operator that normally acts on scalars into a reduction operator to perform that same operation on a list.
PimDaniel Ok tyil. 09:48
thank's to you! 10:17
back later... 10:18
lizmat clickbaits rakudoweekly.blog/2021/02/08/2021-...-remaster/ 10:58
MasterDuke fell for that yesterday, won't get fooled again 11:09
El_Che MasterDuke: monero won't mine itself 11:10
MasterDuke enjoys the weekly, but also really loves The Who and couldn't pass up the chance to use a song title
krako[m] Little question, when I wrote a `one-line loop` `for $lines { say $_ }` , do I have to put a `;` at the end ? 11:51
What's the convention ?
lizmat any closing curly at the end of a line, is considered an end of statement 11:52
krako[m] understood, thanks !
lizmat this works in most of the cases, but not 100%, so every so know and then you get bitten by that
but in my experience, that's like one in 1000 times I've had curlies at the end of a line 11:53
tyil I can't remember ever being bitten by it
lizmat my @a = { code } newline commma { code }
you need to put the comma at the end of the line in that case 11:54
tyil yeah I don't think I've ever tried that :p
lizmat my @a = { code } comma newline { code }
stuff like that
krako[m] Does anyone of you use the `use v6;` pragma ? 12:01
tyil I `use v6.d;`
krako[m] in all of your scripts ?
tyil yes
well, I used to `use v6.c`, Im sure there's some programs that I haven't updated yet 12:02
krako[m] If I use `use v6;` with Raku `v6.d` does it mean that I won't have new features from `v6.d` ? 12:03
tyil I'm not sure if it's actually being used for anything in practice 12:05
in p5 it complained if your perl wasn't at least of the version your specified 12:06
notagoodidea krako[m]: `use v6` will load the latest supported version by the compiler used (most probably Rakudo) without the PREVIEW that enables experimental features. 12:07
PREVIEW could be seen like the `import future` in Python
A saner way to use pragma will be to target your edition of the language wanted as `use v6.d` and upgrade that when new version are available. 12:08
lizmat v6.* will import whatever is newest 12:09
s/import/activate
use v6.* us currently the same as v6.e.PREVIEW
but in future versions, it would still be the newest version, whatever that will be called 12:10
krako[m] what's the default behavior when omitting this pragma ?
lizmat the default version, which is 6.d atm
krako[m] omitting PREVIEV ?
krako[m] *ommiting --> without 12:10
lizmat 6.d <-- D 12:10
6.e.PREVIEW is the "breaking" development version 12:11
to which you have to opt-in
krako[m] Oh ok !
As I hope Raku will be maintained for years, what will be the version after `6.z` ?
notagoodidea krako[m]: When the version is the stable one like `d` right now, PREVIEW will not do anything. 12:12
krako[m] good to know !
lizmat krako[m]: there's been some discussion on what future versions will be called
one proposal is to call the next stable version Raku 2021
notagoodidea And follow the edition schema of Rust? 12:13
krako[m] implicit for one version a year
lizmat not sure we will be able to make it to a version for each year, but potentially, yes
krako[m] ok
I go back to raku studying, thanks ! 12:14
tyil good luck :>
lizmat krako[m]: if you're coming from Perl, you might be interested in reading about the articles I wrote for opensource.com in 2018: opensource.com/user_articles/238941/238941 13:40
krako[m] I come from Python but I also do html/css/js, php and sql 13:42
krako[m] and some shell things with grep/sed/aw/cut/tr/find (also rg and fd) 13:42
krako[m] *aw --> awk 13:45
lizmat krako[m]: ok, it might still be of use to you anyway, just disregard the Perl 5 bits then :-) 14:03
tbrowder lizmat: could you (or some other person with privileges) pls add "issues" and "request reviewers" to the raku/planet.raku.org repo? 14:08
lizmat set up issues 14:10
I'm not sure what I need to do allow for review requests 14:12
El_Che branch 16:01
Settings - Branches - Branch protection rules
add rule
tbrowder ok, the issues works 16:16
lizmat: thnx!
lizmat El_Che: I don't see anything in there about allowing requests for review 16:20
krako[m] <lizmat "krako: ok, it might still be of "> Actually, don't get me wrong but I still don't know if Raku will be for me. I'll mainly use it for short script and one-liners with heavy use of regexes and maybe grammars. 17:07
lizmat krako[m] 17:08
sure
no pb
just trying to be helpful in your quest of learning
krako[m] no problem with that and thank you and others for helping me ! I really appreciate this ! 17:10
El_Che lizmat: strasbourg.apt-get.be/f/4091e2368bc54b9f91c3/ 18:07
jmerelo .seen melezhik 18:39
tellable6 jmerelo, I saw melezhik 2021-01-15T02:30:23Z in #raku: <melezhik> .
PimDaniel Raku is really slow compare to python/PHP/Perl5 :(. Even loading trivial objects is slow. :(. 18:40
El_Che retrieving the debs from bintray, 343 in total, already 3G downloading and counting
PimDaniel: are you measuring the loading of the object or the start of a cold VM? 18:41
PimDaniel cold VM ? May you explain? 18:42
El_Che rakudo runs on MoarVM, one the VM has started loading of object don't look slow to me
it's centainly faster that Perl with an object with the same functionality 18:43
however, Perl startup cost is lower
PimDaniel Well i just run my script and since i made a simple sub that creates some Simple Line(s) objects it becomes really slow. 18:45
In my small method i just have some number comparison with excluded cases that just one case matches. Don't understand why it's so slow. :( 18:46
if /elsif/elsif/elsif. c'est tout! 18:47
which could may be be replaced by another structure like case or so...
krako[m] I'm trying to learn how modules work by reading docs.raku.org/language/modules. 18:48
For now, I want to have/use modules in `./lib`. Is there a better way than using `export RAKULIB='./lib'` ?
El_Che raku -Ilib 18:49
krako[m] works too, thanks ! 18:51
PimDaniel So could we have an already started VM? Or how could we heat it? That it runs faster? It's true that my room is cold. hu! 18:52
El_Che longer running programs benefit from that. For shorts scripts, you can put the code in a lib and call it fron a single line in the script. On the 2nd run the lib will be procompiled 18:54
PimDaniel Well for now it's not so slow. I'll finaly have some factorisations to do into tests, but that should not be the reason. I suppose there's another reason. 18:54
El_Che (3.8G on debs alone, how fast time flies) 18:55
PimDaniel Thank's El_Che. Back later... 18:57
El_Che (yeah, sorry, working on the archive, not so responsive atm) 19:01
lizmat El_Che: that's about *requiring* reviews before merging, not about allowing the op to ask for a review ? 19:04
El_Che ah sorry, I misunderstood the question 19:05
lizmat no pb, glad it is cleared up :-) 19:08
summerisle is there any way to document parameters within declaration block POD (specifically #|) without using line-item comments (#=) 19:22
esp if you use, say, $: 19:23
El_Che lizmat: I just protected one of my repos like that yesterday
hence french in mind
fresh 19:24
lizmat
.oO( aahhh... vlaamse frites :-)
19:30
El_Che :) 19:41
krako[m] To import modules from `./lib` putting `use lib 'lib';` on top of a script works too ! 19:45
Ben93 hi 22:03
notagoodidea hi
sortiz \o
Ben93 What is this chat for? 22:04
notagoodidea To take over the world pinky. Or to talk about Raku the programming language. The later tends to happen more often. 22:06
Ben93 sweet, well I'm trying to strip the white space from a string but I'm really new to raku, any tips on string manipulation? 22:08
notagoodidea You could use `trim`. 22:10
docs.raku.org/type/Str have the methods availaible for a String object 22:12
Ben93 well I need to be able to strip the white space but if something is surrounded in " " then leave it be 22:13
I will start there
notagoodidea Do you have an example?
Ben93 well so like if you have a text file that has a sentience that you pull , but the sentence has quotes like: this is a sentence "with quotes" 22:17
so I want to strip the space between everything unless its between quotes
moritz Ben93: the .words method preserves quoted strings 22:36
m: say q[some words with "a quote" and more stuff].words.join('')
evalable6 somewordswith"aquote"andmorestuff
moritz uhm, nope, sorry 22:37
I'm sure raku has something that does that, trying to remember what
was it <<...>> quoting? 22:38
anyway, sleepy time here, hope somebody else figures out what I'm trying to remember :-) 22:39
Ben93 hmmm ok 22:48
guifa2 summerisle: I mean, you can use #| with parameters. just break each parameter onto an individual line 23:17
summerisle well, of course, but being able to deal with situations not conducive to that or where it would not be desirable would be nice.
i'm also curious about implicit parameters (though I imagine this is not common practice) 23:18
and perhaps implicit is the wrong word here, but it's what comes to mind