🦋 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.
Geth old-issue-tracker: c9a5000782 | (Aleks-Daniel Jakimenko-Aleksejev)++ | README.md
Improve the README a bit
06:24
jmerelo AlexDaniel: so we can use this one now, right? 06:44
AlexDaniel` Yea 06:46
jmerelo AlexDaniel`: can I move any documentation ticket to the documentation repo, for instance 06:47
AlexDaniel` Yes 06:48
jmerelo AlexDaniel`: OK, thanks :-)
AlexDaniel` Well, try and we'll see how it goes
But you should be able to, I think
jmerelo AlexDaniel`: done github.com/Raku/doc/issues/3147 Thanks! 06:50
AlexDaniel`: if any other issue looks like it belongs to documentation, feel free to assign it to me and/or transfer it.
Geth doc: 1e98c5ed0d | (JJ Merelo)++ | doc/Type/Any.pod6
Clarifies permutations, refs #2632
07:08
doc: d6099f61df | (JJ Merelo)++ | doc/Type/Any.pod6
Clarifies combinations, refs #2632
doc: JJ++ created pull request #3149:
Document Mixy.pick/.grab/.kxxv
07:18
scimon Morning 09:08
sena_kun o/ 09:12
tellable6 2020-01-06T21:55:37Z #raku-dev <japhb> sena_kun: There are some known flappers. I don't spectest much, so I'm out of date, but lizmat may know them. zoffix used to keep an up to date list, but I'm assuming that left when zoffix did.
rypervenche I've got a question. I'm very new to Raku (my first programming language). I was curious to know if there's a way to easily remove the newlines from a string better than this? I feel as though there should be a/some method/s for this... gist.github.com/rypervenche/3fa6a0...ff057d95b3 09:18
rypervenche Including creating a scalar with the example string directly in the script, which would be a little different since it would have indenting to keep its shape. 09:20
sena_kun rypervenche, subst(:g) is already a cool solution and is more generic... but, alternatively, you can use `.chop` on each string you got before concatenating. 09:22
sena_kun gist.github.com/rypervenche/3fa6a0...oku-p6-L28 <- just use $_.chomp here 09:23
m: print "hehe\n".chomp
camelia hehe
sena_kun ^ no newline 09:24
m: print "hehe\n"
camelia hehe
sena_kun ^ a newline
rypervenche, ^
rypervenche I guess I'm looking to see if there's a solution without needing the loop. Like this but better (I could do it with one subst, but just doing this quickly) gist.github.com/rypervenche/b2d5bf...28a2e52fbc 09:33
sena_kun rypervenche, you can have one subst just using alteration in regex 09:35
say $var.subst(/\n|\s+/, '', :g);
is enough
rypervenche Ok, thanks. :) I wasn't sure if there was a specific method that might do what I was trying to do. I want to do things the Raku way :) 09:36
sena_kun rypervenche, well, "strip all certain characters from a string and the certain characters are related to ws" is oddly specific to put it into core, I'd say. And removing the condition "if ws" it looks like a job for subst, which is generic enough. 09:38
rypervenche, but keep in mind that when working with stdin using .chomp as was suggested will be more efficient than going with subst for the whole line. it doesn't matter much for such small strings, but when you have a lot of those... 09:39
rypervenche Ah ok. I see what you meant now. I'll mess around with that too. Thanks again. I'm sure I'll be here with more questions once I'm back from vacation. 09:40
sena_kun rypervenche, sure, you are welcome! 09:41
El_Che jmerelo: "Minimalistic, Experimental and Emerging Languages" devroom. I home the commas meand OR and not AND :) 09:51
tellable6 El_Che, I'll pass your message to jmerelo
El_Che and also: 98! 98! 98! 09:52
holyghost . 09:53
tellable6 2020-01-05T18:05:35Z #raku <lizmat> holyghost it's called Raku nowadays :-)
holyghost lizmat : I'm glad I finished it :-) 09:54
holyghost I still have to put a raku compiler on Xliff's server 09:56
El_Che lizmat: I made the error to click on the raku facebook link. Still drama land it seems 09:57
holyghost I am reading "Monte Carlo Methods in Bayesian Computation" now
lizmat clickbaits rakudoweekly.blog/2020/01/06/2020-...foresight/ 11:00
scimon I am confused about complex exponents. 16:52
m: i ** 2
camelia WARNINGS for <tmp>:
Useless use of "**" in expression "i ** 2" in sink context (line 1)
scimon m: say i ** 2
camelia -1+1.2246467991473532e-16i
scimon Why isn't that -1? Is this a Math thing I have misunderstood.
AlexDaniel scimon: it looks like -1 to me 16:53
scimon m: say i * i 16:54
camelia -1+0i
AlexDaniel scimon: look it's e-16, so you got -1 with a reeeeally small i
m: say round(i ** 2, 0.00001) 16:55
camelia -1+0i
scimon I just wonder why. The docs say we coerce the exponent to a Complex number before doing the equation and I'm guessing this is why the result. I'm just wondering why we're doing that.
AlexDaniel scimon: it's just floating point noise 16:56
I think
scimon (I don't know why I care, complex numbers are not something I'm ever going to use it just confused me)
scimon Running away. Bye. 17:00
tobs scimon: I think this candidate (from the docs) catches the 2 exponent and does floating-point exponentiation which introduces the noise, instead of doing i*i: multi sub infix:<**>(Complex:D \a, Num(Real) \b --> Complex:D) 17:02
tellable6 tobs, I'll pass your message to scimon
tobs there doesn't appear to be a Complex[Rat]-like thing for when a subset of the complex numbers suffices on which you want to be precise. 17:04
[Coke] m: say (i**2).round(1e-5)
camelia -1+0i 17:05
guifa2 for methods that validate data, would it be better to do method valid(-->Bool) { so $valid }, or method validate { die unless $valid } ? 18:25
I suppose I can do support both in a module, but didn't know if there might be a preference 18:26
jmerelo guifa2: depends on validation, and what it means. The first would be OK for most, but in other cases it might be better to throw a typed exception (so, no die)
tellable6 2020-01-07T09:51:58Z #raku <El_Che> jmerelo: "Minimalistic, Experimental and Emerging Languages" devroom. I home the commas meand OR and not AND :)
jmerelo .tell El_Che Hope so, also. If not, the talk would be too short. Raku is not Minimalistic. That's it. (well, not experimental any more, either) 18:27
tellable6 jmerelo, I'll pass your message to El_Che
chloekek guifa2: neither, make a data type that has an invariant that the data is always valid, and return that. 18:43
jmerelo chloekek: good one :-)
guifa2 this is for language tags. They can be well-formed (or not), canonical (or not), or valid (or not). mzz-ES is canonical but not valid, Es-SE is valid but non-canonical, mZy-dE is neither canonical nor valid, en-US is canonical and valid, and -foo is not well formed, and thereby not canonical or valid 18:54
My classes ensure well-formedness, but not the others. Classes can't change their type via self = foo, sadly 18:55
(well, they can do also does Foo, but there's no way to retract that once it's established)
guifa2 to me, canonical() and valid() should just return a Bool, but it seems less useful if you don't know why, and I don't think a False but Rationale is a model that people would necessarily expect. Hence the thought to use validate() and throwing an exception that's more coded 18:59
guifa2 knows he's overthinking it, but thinks LanguageTag is a module that deserves the extra forethought 19:00
sjn has designed some Raku stickers to bring to FOSDEM this year o/
anyone here planning on going? 19:02
jmerelo sjn: I'll be there 19:07
sjn: the Perl foundation is organising a Perl/Raku table, also, so you might want to get in touch with them.
sjn jmerelo: have already received a mail from Curtis & Stuart 19:08
jmerelo sjn: great :-)
sjn they're not very responsive though :-P
I'd love to have a discussion on how to make the Perl/Raku booth a nice place 19:10
jmerelo sjn: did you get a link to the wikiwhatever for the organization?
sjn no
jmerelo Let me check
sjn: here codimd.opusvl.com/_Fb73361QgiCbqq2jz6Wvg# 19:11
sjn thanks 19:14
sjn is printing 2150 stickers in 3 designs 19:15
jmerelo sjn: great. Can you share the designs?
tadzik I'm skipping FOSDEM this year, but I'm sure there'll be quite some interest in the booth :) Good to know there's good people behind it 19:18
jmerelo tadzik: hope so. At least we won't need to introduce Raku as "Not quite the next version of Perl, which, BTW, is not dead" 19:19
tadzik :P
sjn jmerelo: www.dropbox.com/sh/x8yjm7s73idbjrf...TBHKa?dl=0 19:20
jmerelo sjn: beautiful. Thanks!
sjn: 1337 as in 1337 hax0r?
sjn yeah :)
jmerelo sjn++ 19:21
releasable6: status
releasable6 jmerelo, Next release will happen when it's ready. 1 blocker. 0 out of 409 commits logged
jmerelo, Details: gist.github.com/ba2ef87a6d3d38b5f9...3607fd8b6a
jmerelo just checking to see if there will actually be a Raku 2020.01 by then. I guess it will.
sjn hopes so too 19:22
a Star release would be great too
AlexDaniel Altai-man_: no pressure!
:D
guifa2 Altai-man_: thanks for the heads up on my build error btw 19:23
lizmat sjn: mind if I show them in the next Rakudo Weekly ? 19:35
Altai-man_ guifa2, you are welcome. :) 19:39
jmerelo, there will be a release, I hope, once we'll resolve github.com/perl6/Blin/issues/17 and I'll run blin a couple of times more. :)
I still have no idea how / who can update the docker image. 19:40
jmerelo Altai-man_: Let me see if I can help with that
Altai-man_ maybe El_Che can help with github.com/perl6/Blin/issues/17 ? 19:46
Altai-man_ runs away to read some books
sjn lizmat: we'll take some pictures for you at FOSDEM :) 19:49
for now, I'd like some feedback before they are sent to the printer's
lizmat is the text at the bottom of the Wanted one supposed to be legible or not? 19:50
sjn It's not supposed to be legible 19:51
props to anyone who knows where the poster is from :)
Geth ¦ problem-solving: lizmat assigned to jnthn Issue Expose nqp::findcclass and nqp::notfindclass functionality github.com/perl6/problem-solving/issues/146 20:04
Tirifto Hello! How should I go about loading modules from a certain non-standard directory, if I need it for a single script only? Should I temporarily add it to the environment variable ‘PERL6LIB’? The documentation also mentions the ‘use lib’ pragma, but I haven't found an explanation of what it does. 20:20
Tirifto (Context: I’d like to make my script extensible, and loading modules with routines that will be called on its data is the best way I thought of.) 20:28
Geth ¦ whateverable: AlexDaniel unassigned from zoffixznet Issue Support \U github.com/Raku/whateverable/issues/234 20:33
guifa Tirifto: use lib is what you want 20:51
For example, let’s say my script is at …/script.raku. I might have two modules at in …/mymods/Foo.rakumod and …/mymods/Bar.rakumod 20:53
inside of script.raku, I’d just say use lib ‘mymods’; and then you can say use Foo; and use Bar;
Tirifto guifa: Aha! So ‘use lib foo’ adds a new path for Raku to look for modules in? 20:55
guifa Actually, I may have that slightly off — you might need to put them in a directory called ‘lib’ and point use lib to the parent. I can’t recall right off hand which it is, but if you play around you’ll figure it out fast I’m sure :-) 20:56
Just double checked — the way I said it at first was correct, my memory isn’t failing me for once 20:59
Tirifto guifa: Splendid; thank you! :-)
guifa But you’re right we could improve the documentation on it. There is actually a ticket on it github.com/Raku/doc/issues/2105
tyil I made a module to turn pod into (part of) an html doc, which works with cgit. it turns home.tyil.nl/git/raku/App::Assixt/...EADME.pod6 into home.tyil.nl/git/raku/App::Assixt/about/ 22:22
:D
uzl[m] tyil++ 23:23
.tell Tirifto You could use RAKUDOLIB/PERL6LIB to add a path to the list of modules that must be searched. Assuming guifa's example was under 'lib', you could run 'RAKUDOLIB=lib raku script.raku' provided the script is in the same directory as 'lib'. In the script, you'd use the module like you regularly do without 'use lib ...'. I find this way more versatile since I can just zef install the module and use it right away in the
script.
tellable6 uzl[m], I'll pass your message to Tirifto