00:03
guifa joined
02:49
hulk joined,
kylese left
03:15
hulk left,
kylese joined
04:51
Aedil joined
04:52
Aedil left
04:58
Aedil joined
07:51
lizmat joined
08:27
sena_kun joined
09:22
lizmat left
09:43
Aedil left
10:58
Sgeo left
12:41
msiism joined
|
|||
antononcube | I only see “Net::IP::Parse” and ”IP::Addr” in raku.land. | 13:15 | |
Did you mean the former? | 13:17 | ||
guifa | whoa I missed IP::Addr | 13:43 | |
13:51
perlbot left
13:52
simcop2387 left
|
|||
timo | github.com/MoarVM/MoarVM/pull/1866 can i get some input from users regarding this? it's about the behaviour of Supply.interval and anything that uses ThreadPoolScheduler's $*SCHEDULER.cue with the "repeat on interval" feature. currently we get relatively even timings between ticks but always a little bit more than you ask for. with this pull request you'll get less even distances between | 13:59 | |
consecutive ticks, but the distance from an idealised "start time + interval * i" doesn't increase nearly as much over time | |||
guifa hates that Nil throws an error on stringification | |||
.?Str is basically an impossibility | 14:00 | ||
timo | m: say Nil.gist | ||
camelia | Nil | ||
timo | not an option for your case? | ||
guifa | my $a = Nil; my $b = $a.?Str.?parse-base(16) | 14:01 | |
m: my $a = Nil; my $b = $a.?Str.?parse-base(16) | |||
camelia | Use of uninitialized value $a of type Any in string context. Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful. in block <unit> at <tmp> line 1 |
||
guifa | my $a := Nil; my $b = $a.?Str.?parse-base(16) | ||
m: my $a := Nil; my $b = $a.?Str.?parse-base(16) | 14:02 | ||
camelia | Use of Nil in string context in block <unit> at <tmp> line 1 |
||
guifa | the whole point of .? is that I should just end up with Nil at the end of that | ||
right? | |||
m: my $a := Nil; my $b = $a.?Str | 14:03 | ||
camelia | Use of Nil in string context in block <unit> at <tmp> line 1 |
||
guifa | oh wait no I dumb | 14:04 | |
.? is for if the method exists, not if the object exists | |||
which would normally be the same with Nil, except we do have a method on Nil for Str | |||
timo | of course you can "quietly" | 14:05 | |
do not print quietly into that good method call | |||
m: sub do-it($a) { my $b = .Str.parse-base(16) with $a; say $b.raku; }; do-it(Nil); do-it("99"); do-it("dog") | 14:07 | ||
camelia | Any Cannot convert string to number: malformed base-16 number in 'd<HERE>og' (indicated by <HERE>) in sub do-it at <tmp> line 1 in block <unit> at <tmp> line 1 153 |
||
14:08
simcop2387 joined
14:09
perlbot joined
14:11
Aedil joined
14:46
guifa left,
guifa joined
|
|||
ab5tract | After using Kotlin a bit, I appreciate having syntax that means “call method if object is defined, else return undefined” | 14:59 | |
Maybe we could add a ‘.??’ … but then again, core may well be fully saturated already :) | 15:01 | ||
15:19
sena_kun left
15:21
sena_kun joined
|
|||
librasteve | ab5stract: good idea! | 15:38 | |
ab5tract | I’ve also toyed with a ‘///‘ op, which would be “defined-or-do’, but that falls more directly into the pure sugar category | 15:44 | |
$maybe-nil.??method /// return | |||
timo | so it'd be a bit like "orelse"? | 15:46 | |
msiism | Hi, what's the difference between binding (`:=`) and using the `constant` prefix in declarations? | 15:59 | |
guifa | you can still rebind | 16:04 | |
timo | "constant" happens at compile time | ||
guifa | m: constant $a = 5; $a = 6; | ||
camelia | Cannot assign to an immutable value in block <unit> at <tmp> line 1 |
||
guifa | m: my $a := 5; $a := 6 | ||
camelia | ( no output ) | ||
msiism | I see, thanks. So, bound variables are sort of like "soft constants" then? | 16:05 | |
guifa | sort of. It's more that they don't have containers | 16:06 | |
16:07
abraxxa-home joined
|
|||
msiism | Okay, I'll keep a note. | 16:07 | |
timo | well, they don't come with containers of their own, even though you can bind a container into a variable | 16:09 | |
m: constant WHOA = Scalar.new(); say WHOA.raku; WHOA = 5; say WHOA.raku; | |||
camelia | ===SORRY!=== Error while compiling <tmp> An exception X::Cannot::New occurred while evaluating a constant: Cannot make a Scalar object using .new at <tmp>:1 Exception details: Cannot make a Scalar object using .new in block at <tmp>… |
||
timo | ok makes sense | ||
m: constant WHOA = my $ = 99; say WHOA.raku; WHOA = 5; say WHOA.raku; | |||
camelia | 99 5 |
||
msiism | I don't get "doesn't come with a container", though. | 16:10 | |
timo | here we have a container that was bound to a variable that would otherwise not have a container, and that makes it assignable "again" | ||
right, so if you "my $foo = 5" you get a scalar container that the 5 is put into, and if you "my $foo := 5" you don't get the container because binding is what you use to get around containers / assignment semantics | |||
but if you "constant foo = 5" there is no container there | 16:11 | ||
even though you didn't use the := operator | |||
msiism | Okay, I need to read up on containers in Raku, apparently. | 16:12 | |
timo | there's a documentation page on it under language/containers | 16:15 | |
feel free to ask any further questions | |||
msiism | Yeah, I surely will. :) Just started slurping the Raku Guide plus bits from the official documentation yesterday. | 16:18 | |
timo | cool. i tend to be very interested in what people with fresh eyes stumble upon. that's an excellent source for potential improvements. so feel free to be very verbose about your journey of exploration, if that's OK with you of course | 16:23 | |
msiism | Okay, so, basically, what I'm doing right now is going through the Raku Guide (which is very helpful to get started) and occasinally the official docs and building my private Raku quick reference maunual out of that. | 16:26 | |
When I have more experience, I'll probably be tempted to make some suggestions for the Raku Guide. | 16:28 | ||
timo | nice. the raku guide is nice, though i haven't looked at it myself in a good while | 16:29 | |
librasteve | yeah - i like the raku guide --- its the "right" length and reminds me of the Rust book | 16:30 | |
msiism | Just reading section "Literal lists" at docs.raku.org/language/list. | 16:47 | |
It contains the following piece of text: | |||
"Because the semicolon doubles as a statement terminator it will end a literal list when used at the top level, instead creating a statement list. If you want to create a statement list inside parent hesis, use a sigil before the parenthesis:" | |||
I'm not entirely sure, but I think this should rather be written something like: "Because the semicolon doubles as a statement terminator, it will end a literal list when used at the top level, instead of creating a statement list. If you want to create a statement list inside parentheses, use a sigil before the opening parenthesis:" | 16:48 | ||
librasteve | msiism: I agree ... we had a period of very helpful volunteers working on the docs (but they were not all native english speakers) and we could always use good feedback like this to improve them. When you see potentiak improvements like this, hit the pencil icon on the page and it will take you to the GH source ... the ideal way to propose a fix is to fork the raku doc repo, make the edits in your fork and pR back | 16:52 | |
for review... | |||
16:53
sena_kun left,
sena_kun joined
16:56
sena_kun left
16:57
sena_kun joined
|
|||
msiism | Okay, I'll keep a note. I'm kind of trying to avoid GitHub as much as I can now, though. Is there any other acceptable way? | 16:58 | |
timo | I can understand wanting to avoid github | 16:59 | |
feel free to just have a clone hosted anywhere that allows any raku dev to pull from you, that should be fine | 17:00 | ||
msiism | Okay, fine. | ||
timo | for discussion / review we do have a mailing list if you find that acceptable, otherwise IRC / discord are also acceptable at least from my perspective | ||
i'd like it if we migrated away from github more, but i'm afraid the right kind of volunteer-hours for that kind of project are scarce | 17:02 | ||
msiism | Mailing lists and IRC are both fine with me. | ||
timo | we did have RT instead of github issues before, and it was a big improvement to go to github instead of RT, but i guess that's a low bar to clear :D | 17:03 | |
msiism | I don't have any experience with RT. Seems I can count myself lucky. :) | 17:05 | |
timo | well, it's certainly no Jira | 17:08 | |
17:11
abraxxa-home left
17:24
lizmat joined
|
|||
msiism | Looking into lists, I encountered a problem with trying to extract elements of a list assigned to a scalar variable, which is probably not what you're supposed to be doing. | 17:30 | |
Here's an example: paste.debian.net/plainh/34d85391 | |||
timo | that's coming from the assignment syntax unpacking your list on the RHS into what could be a list but is only one variable on the LHS | 17:31 | |
oh, is it the precedence | 17:32 | ||
m: my $alist = (1,2,3,4); say $alist[1]; | |||
camelia | 2 | ||
timo | right, the precedence was making "my $alist = 1" the first element of the list the , operator is creating there | 17:33 | |
msiism | Oh, okay. | ||
timo | m: my @alist = 1,2,3,4; say "the alist with at sign is ", @alist.raku; | 17:34 | |
camelia | the alist with at sign is [1, 2, 3, 4] | ||
timo | when assigning to a @-sigiled container it uses a different precedence level | ||
$ is meant for single items generally, that's probably the reason for this difference | 17:35 | ||
m: my $alist = 1..4; say $alist.raku | |||
camelia | 1..4 | ||
msiism | But it works when you use binding. | 17:36 | |
timo | m: my $alist = (1..4).list; say $alist.raku | ||
camelia | $(1, 2, 3, 4) | ||
msiism | So, when I want to deal with list-like data, is it generally better just to go with an array? Seems so. | ||
timo | m: my $alist := 1,2,3,4; say $alist.raku | ||
camelia | (1, 2, 3, 4) | ||
timo | often, yeah | ||
there's also the difference between List and Array to consider, which has implications for the mutability | 17:37 | ||
m: my $alist = (1,2,3,4); $alist[2] = 99 | |||
camelia | Cannot modify an immutable List ((1 2 3 4)) in block <unit> at <tmp> line 1 |
||
timo | m: my @alist = (1,2,3,4); @alist[2] = 99; say @alist.raku | ||
camelia | [1, 2, 99, 4] | ||
timo | a @-sigiled variable will be an Array by default, which makes nice writable containers for you in every slot | 17:38 | |
msiism | It seems to me like lists in Raku are primarily useful in contrcuts like for <list> { … } and probably a dozen others, but they're not lists like in Tcl or Scheme. | ||
timo | m: my $alist = (1..*).list; say $alist[99] | 17:39 | |
camelia | 100 | ||
timo | lists can also be lazy lists | ||
lucs | I just fixed an issue reported in one of my github repos. | 17:40 | |
I'm quite certain that the fix is correct and I commented on the issue as such and closed it. | |||
Is that proper etiquette or should I have waited for the person who opened the issue to close it? | |||
timo | since there's also the feature where putting a line like "Fixes: #1234" into your commit message will automatically close issues, I think it's fine to close the issue and if necessary the user can re-open it | 17:41 | |
lucs | Oh, I didn't know about that feature. | 17:42 | |
Next time, I'll do that (pretty sure there'll be a next time :-) | 17:43 | ||
timo | I tend to put a "thank you" message in the issue anyway | ||
lucs | That, I did. | ||
timo | that's a good place to put a bit to the effect of "feel free to re-open if the fix is not enough" or something like that | ||
[Coke] | (fork doc repo) also happy to add privs for repeat contribs. | 18:22 | |
18:31
lizmat left
18:45
lizmat joined
19:38
Aedil left
|
|||
librasteve | msiism: the raku.guide presents a coherent subset of raku as an introduction - per timo comment and the guide, just use an @ sigil where you need many things and it provides a typical Array with similar features to other languages | 19:40 | |
once you are conversant with the guide stuff, then you are ready for the language references - docs.raku.org/reference | |||
in this case docs.raku.org/language/list Lists, Sequences and Arrays is a good next level deeper imo | 19:42 | ||
19:43
Sgeo joined
|
|||
you may also like docs.raku.org/language/containers based on the above discussion | 19:43 | ||
I prefer to use the @ sigil and Arrays over Lists since the raku designers provided lots of features to make that do what I mean (but I respect that the other animals in the List zoo have a role to play depending on the task) | 19:46 | ||
20:07
Sgeo left
|
|||
antononcube | It seems numerical properties of 2025 provoke(d) fair amount of interest. | 20:09 | |
Is there are a more elegant way to write the this in Raku: (e ** π + π ** e).floor ** 2 ? (Gives 2025.) | |||
I tried to use different superscript entering methods without successs. | 20:10 | ||
20:10
Sgeo joined
|
|||
I know this works: floor(e ** π + π ** e)² | 20:10 | ||
msiism | librasteve: How about course.raku.org/? | 20:34 | |
librasteve | Andrew Shitov is a great raku contributor, sorry to say I have not read this course so not able to comment | 20:40 | |
on the content | |||
21:35
sena_kun left
21:38
Sgeo left
21:41
Sgeo joined
|
|||
leont | Is there something nowadays that prevents me from having to manually type my fez password? | 22:06 | |
tellable6 | 2024-12-30T15:12:41Z #raku-dev <finanalyst> leont I solved my module inside prove6 problem. Turns out it was a path spelling error on my part. Everything fine now | ||
msiism | What is the "telemetry snapper" in Rakudo? | 22:09 | |
patrickb | leont: AFAIK it won't ask you again once logged in (and until the token expires, unsure what the lifetime is though). | 22:17 | |
leont | patrickb: yeah, it expires | 22:18 | |
Just give me a configuration file until the thing is smart enough to understand key rings. | |||
23:36
sivoais_ left
23:38
sivoais joined
23:40
sivoais left,
sivoais joined
|