🦋 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.
neshpion how come `get` behaves differently in a heredoc using `raku <<-"EOF"\n<script>\nEOF` vs in a .raku file running as `raku script.raku` ? termbin.com/z9sw 02:31
cj hey folks 03:06
is cromedome about?
I have a 20-core 32-gig k8s system to offer for the CI integration bot 03:08
or possibly Patrick Böker
raku-bridge <勉人> Whats the difference between my/our/has? 03:11
cj my and our are generally for scoping variables to a namespace 03:12
has tells you whether a namespace has a symbol in it, I think
raku-bridge <勉人> Uhhh…
<勉人> Not sure what that mean
cj my $foo = x; (within the current namespace, we create a variable called $foo and assign it a value) 03:13
that $foo can only be referenced from within the current namespace.
brass neshpion: If I had to guess, it's because a heredoc is treated as stdin, which messes up `get`
cj with `package lala; our $foo = x;` the current namespace can manipulate the variable, but you can also refer to it as $lala::foo from code outside the current namespace 03:14
brass When you call a file with `raku <file>`, you're telling it to interpret that file, but leaving stdin connected to the terminal
neshpion oh so then it must automatically be eating its own heredoc as the input to `get`, and then it hits `$name` which is undefined and throws the error 03:15
brass That would be my guess
Heredocs are fed as stdin to the called program 03:16
neshpion: Actually now that I think about it, I bet raku waits for the end of the heredoc before compiling the program and running it, so by the time it reaches the `get`, stdin is already closed and it returns Nil 03:24
neshpion that makes more sense 03:25
and then i try to read $name in a `say` line
which is NiL
raku-bridge <勉人> Thank you cj 04:24
cj sure thing. I would google for `raku namespace our` 05:04
docs.raku.org/language/packages 05:05
jmerelo We're going to try and submit another application to Google Summer of Code this year github.com/perl-foundation-outreac...2021-ideas In this phase, we need project ideas people are willing to mentor. Submit yours (through PR) there. 08:35
PimDaniel what this complains "multi method sequence256(uint8 $color, uint8 $bgcolor,Bool :$str=False) {" with: 09:59
Lexical with name '$color' has a different type in this frame
this multi is alone
PimDaniel 10:00
hazim Hello, i like to ask if someone successfully install Cro, it cant compile. 10:07
PimDaniel hazim: May i help you? what is the compile error? 10:10
But I do not know Cro, so may be i'm not the best one to help you. 10:11
hazim thanks PimDaniel, it is from cro.services/ 10:12
PimDaniel what is Cro?
:hazim thank's! i'm watching... 10:13
hazim it cant install, 10:14
PimDaniel hum : interesting 10:16
How it can't install? Have you a log trace? 10:17
Hooo yes : this is zef managed, i'm not very used to it! 10:19
hazim i copy the output 10:20
in method build at /home/hazim/.zef/store/p6-digest-sha1-native.git/e34d468341a572a7c089d672429cf88d21e07734/Build.pm line 14
[Digest::SHA1::Native]   in block <unit> at -e line 1
===> Building [FAIL]: Digest::SHA1::Native:ver<0.04>
Aborting due to build failure: Digest::SHA1::Native:ver<0.04> (use --force-build to override)
i use fedora 33 it should install, 10:21
thanks for help and your time PimDaniel
PimDaniel Is it heavy? I'll try on my Linux.
Do you know zef?
hazim yes it is heavy, zef no i just use the command as it is 10:22
PimDaniel It seams that it's a Native part that did not compile but you should have possibility to get more precise log. 10:23
A kinda library did not compile.
PimDaniel on Libraries it's often un unresove dependency. 10:24
I'm on Debian 10.
hazim yes i think  it is  un unresove dependency i will try ubuntu or debian 10:25
jmerelo .tell hazim that fails from time to time. You can try and install it by hand in advance. 10:29
tellable6 jmerelo, I'll pass your message to hazim
jmerelo PimDaniel: cro is a net services framework, including microservices. It's very cool.
PimDaniel :jmerelo very interesting! 10:30
jmerelo PimDaniel: can you repeat again the question you made at 10:59? A bit of context doo?
lizmat yeah, that looks like a bug 10:33
elcaro PimDaniel: from what I can tell it's hitting this Exception in NQP-land
github.com/Raku/nqp/blob/a2435ee1f...tx.js#L405
PimDaniel YES: Try to make a CLASS A and into this class a method with one int8 try to use it with a number in the caller, next change that method to multi
elcaro probably best to raise a GitHub issue on Rakudo repo with a code snippet that reproduces the issue 10:34
PimDaniel I mean a method with an int8 parameter, then after, change it to multi it does not recognize type., then change multi to Int , it does.
No problem i'll do it. 10:35
.tell hazim i tried to install cro and i got theses erreurs => /usr/bin/ld : ne peut trouver -ltommath /usr/bin/ld : ne peut trouver -latomic_ops 10:36
tellable6 PimDaniel, I'll pass your message to hazim
PimDaniel .tell hazim but theses are easy to resolve has you may know, but you can may be check if you have theses libraries anyway. 10:38
tellable6 PimDaniel, I'll pass your message to hazim
PimDaniel clear
oh sorry
I prepare my piece of code 10:39
jmerelo PimDaniel: those seem to be MoarVM dependencies. Also, if that's Fedora, the second one might be indeed a problem with Raku 11:15
PimDaniel :jmerelo i did not go futher for now. 11:21
Not sure i want to install it on my machine for now.
I wonder if what i try to describe is a bug.
when i say 42 what type is it? 11:22
What is Num compare to Int? 11:23
jmerelo PimDaniel: Num is any kind of number 11:24
PimDaniel :jmerelo , OK!
jmerelo PimDaniel: Int is, well, an integer
PimDaniel If i want to convert to a smaller type : eg uint6 how to i make it? 11:25
There's no conversion method , no? 11:26
Not for this type AFAIK. 11:27
re '42.uint16.say' => No such method 'uint16' for invocant of type 'Int'. 11:28
This seams to pose problem for multi methods , and maybe subs. 11:31
jmerelo uint16 is a native type, which is always "boxed" into a "normal" type. So no, there's no conversion method. docs.raku.org/language/nativetypes...try-uint16 They are mainly for nativecall functions. 11:32
PimDaniel If i didn't paste code yet it's because i'm wondering and testing since 1 hour, but i'll post anyway. 11:34
elcaro PimDaniel: just to clarify, Num is not any number... it's Raku's floating point type 11:53
PimDaniel elcaro: hoo hoo !
elcaro if you want a function to accepts any numeric valua, use Numeric (or Real if you don't need to support Complex numbers)
PimDaniel Okay Okay : good to know! 11:54
but i'll post my code soon anyway.
elcaro secondly re native types... I think in my limited NativeCall experience, your public facing function can have foo(Int $x)... which can pass to your native function bar(int32 $x), and it will work 11:55
unless your Int is too big, in which case... you have to validate that yourself in the outer function
PimDaniel Yes, i watched that!
But it should work and control proper type i think! 11:56
Or it's a type problem or it's a signature problem which is linked anyway.
I do not say it's a bug, but i need to publish just to see. 11:58
elcaro You could also create a subset: subset Int8 of Int where * ~~ -128..127; foo(Int8 $x) { bar($x) }
PimDaniel yes but this is a workaround. 11:59
PimDaniel Well in fact: i made a sutile error: to avoid method|sub many(uint8 $a,uint8 $b, Bool :$str=False) the ':' here is no use and produces bad behavior. 12:44
Now it just does not work with constant litterals which is correct since thez are considered Int.
PimDaniel and for this case, the subset is a solution. 12:55
raku-bridge <ionsolo> hello I'm stuck with some concepts, for example what does bless? 15:09
<ionsolo> I already read the docs about but i need some explanation more easy for this 😭 15:11
El_Che ionsolo: skip it 15:13
ionsolo: for now
El_Che iosolo: it's a low level object construction method, generally not needed on regular code where raku's high-level OO shines 15:14
raku-bridge <ionsolo> OK, thanks!! 15:42
<ionsolo> but what is the high level counterpart? a declaration itself? 15:44
<ionsolo> the case that bless is named 'bless' doesn't help to see what's does haha 15:46
PimDaniel raku-bridge: bless create the instance. But note that whell you build a constructor, you overload the default one. 15:57
PimDaniel .tell raku-bridge bless also assign constructor scope variables or any values to class parameters. 16:00
tellable6 PimDaniel, I'll pass your message to raku-bridge
raku-bridge <ionsolo> @PimDaniel sorry my internet has a terribly intermitance these days, thanks 17:16
guifa o/ 17:47
pilne shalom rindolf! how are you? 18:55
rindolf pilne: i'm fine - worked on www.shlomifish.org/humour/Queen-Padme-Tales/ (uses p5 though - not raku) 18:59
pilne ahhh, your freecell solver is in p5 too? 19:38
guifa Is there a reason double underscores are verbotten in numbers? 21:37
tonyo so people don't write 5___________________________________________0 ? 21:39
so we don't get made fun of pythoners twitter.com/oynoto/status/1354511375981133824 ??
guifa tonyo: I guess, but in this case I have some hex numbers I wanted to align, and while I can do it with 0s, underscores would have given a lot less visual clutter 21:42
Just semed weird, it’s not like a double could be interpreted as anything else 21:43
tonyo i hear ya. i don't see any real reason not to. if someone wants to do something like that 5_...0 thing then .. who really cares 21:47
guifa Now the abuse I had to work hard to avoid was using a Unicode/emoji symbol instead of the word “skeleton” in my subs that have skeleton in them :-) 21:55