🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
Xliff \o 13:06
Altai-man o/ 13:11
[Coke] . 13:19
tellable6 2021-09-08T22:17:37Z #raku <tbrowder> [Coke] new doc PR is #3955, merged and closed, i think it is fine
jdv lizmat: a very minor thing - could the logs live page be made a bit more updatey? maybe a meta refresh and a count of new lines or whatever in the title... 14:30
lizmat jdv: that is being worked on! 15:21
in fact, I hope to be able to put the new layout live before the end of the month :-) 15:22
Geth doc/routine-multi: d418a61e72 | (Daniel Sockwell)++ (committed using GitHub Web editor) | doc/Language/variables.pod6
Note that &?ROUTINE refers to current multi

This commit adds a note that &?ROUTINE refers to the current multi candidate and compares it to callsame, which allows self-recursion to the entire proto.
15:23
doc: codesections++ created pull request #3957:
Note that &?ROUTINE refers to current multi
doc/samewith: 3faf5376e5 | (Daniel Sockwell)++ (committed using GitHub Web editor) | doc/Language/functions.pod6
Correct description of samewith

The docs previously stated that samewith calls the same multi _candidate_, but samewith calls the entire multi. This commit corrects that, and adds an example that illustrates samewith's behavior.
15:33
doc: codesections++ created pull request #3958:
Correct description of samewith
15:37
jdv lizmat: neat, thanks 15:42
Geth doc: 01887df0a5 | (Daniel Sockwell)++ (committed by Juan Julián Merelo Guervós) | doc/Language/functions.pod6
Correct description of samewith

The docs previously stated that samewith calls the same multi _candidate_, but samewith calls the entire multi. This commit corrects that, and adds an example that illustrates samewith's behavior.
15:43
linkable6 Link: docs.raku.org/language/functions
Geth doc: 1ef056b1fb | (Daniel Sockwell)++ (committed by Juan Julián Merelo Guervós) | doc/Language/variables.pod6
Note that &?ROUTINE refers to current multi

This commit adds a note that &?ROUTINE refers to the current multi candidate and compares it to callsame, which allows self-recursion to the entire proto.
17:34
linkable6 Link: docs.raku.org/language/variables
Geth doc: c730122bec | Coke++ | xt/word-variants.t
Add "call site" variant

Prefer over callsite, call-site
19:03
doc: 0caaea403a | Coke++ | doc/Language/functions.pod6
prefer 'call site'
linkable6 Link: docs.raku.org/language/functions
Geth doc: 8966a49f14 | (Alexander Hartmaier)++ | doc/Language/operators.pod6
add Set operator character explanations
19:48
doc: 2d5418e10d | (Will Coleda)++ (committed using GitHub Web editor) | doc/Language/operators.pod6
Merge pull request #3919 from abraxxa/master

add Set operator character explanations
linkable6 Link: docs.raku.org/language/operators
guifa So my google fu failed me and I forgot to note it. What do we do for testing out the new-disp branch? Just build it or are there any flags we need to set? 20:03
ah here we go 20:24
--gen-nqp=new-disp
gfldex perl Configure.pl --force-rebuild --gen-moar=new-disp --gen-nqp=new-disp --make-install 20:26
guifa: ^^^ from the last weekly
guifa boos Google for requiring about two dozen different combination of search terms to find it haha
moon-child m: 0x_5 20:37
camelia WARNINGS for <tmp>:
Useless use of constant integer 0x_5 in sink context (line 1)
moon-child m: 0_x5
camelia 5===SORRY!5=== Error while compiling <tmp>
Confused
at <tmp>:1
------> 0307⏏5_x5
expecting any of:
whitespace
moon-child :/
Rogue Is there a way to specify that a captured type needs to be a parameterizable role with one parameter? 21:22
For example in Scala one can say `trait Functor[F[_]]` 21:23
So the Raku equivalent would look something like `role Functor[::F ??? ]` 21:24
moon-child I think you can use 'where' 21:25
Rogue I was thinking the same but I'm not sure how to check those things with the MOP 21:29
I guess part of it can be done with `where *.HOW ~~ Metamodel::ParametricRoleHOW` 21:31
moon-child that will also match roles with multiple parameters though 21:32
Rogue yeah
moon-child you could check whether *.^parameterize(Any) errors, but that's ugly
err, no
Rogue It would be nice to have syntax for this that doesn't involve touching the metamodel 21:33
which is technically not part of the lang spec
moon-child you want to look at the contents of metaobjects. What tool could you wish for other than a metaobject protocol? 21:34
Rogue I mean yeah 21:35
But I could wish for some nice syntax for this particular case, like what Scala provides :) 21:37
moon-child here we go! 21:41
T.^candidates.map(*.^body_block.arity).any == 2
Rogue Wow, that's next-level 21:42
Hm, apparently we "Cannot do non-typename cases of type_constraint yet" according to my Rakudo 21:44
moon-child hmm. I was going to say, you should be able to work around that with a subset. But it doesn't seem to work here 21:46
oh, yes, you can 21:47
subset OneParameter of Mu where *.^candidates.map(*.^body_block.arity).any == 2; role Functor[OneParameter ::T] { ... } 21:48
should work, I think
oh, you need to check arity <= 2 <= count 21:51
Xliff m: DateTime.new(1).gist.say 22:52
camelia 1970-01-01T00:00:01Z
Xliff How can I get that to read properly in my TZ?
So 1/1/70 00:00:01 -04:00
Datetime should have a new-local, I think. 22:53
[Coke] github.com/raku-community-modules/...e-TimeZone
gfldex m: DateTime.new(1, :timezone(-4*3600)).say 22:54
camelia 1969-12-31T20:00:01-04:00
Xliff hehehe
[Coke] perhaps github.com/alabamenhu/DateTimeTimezones
gfldex m: DateTime.new(1).in-timezone(-4*3600).say
camelia 1969-12-31T20:00:01-04:00
Xliff [Coke]: Is that availble via zef? 22:55
gfldex: Trust me, I've tried most of the variants of that and still get a value in 1969.
[Coke] I found it on the modules site, so probably. 22:57
I didn't try either of them, let me try the latter.
.... as soon as MTGA is done launching, jeez.
Xliff "zef install DateTimeTimezones" does not work. 22:58
[Coke] ah. "(NYI) The formatter has been changed to indicate the timezone. This makes it incompatible with RFC 3339. The use option 'rfc3339' will restore the original formatter. 23:01
it's "DateTime::Timezones" - search for it on modules.raku.org, then use the name its listed under there.
Xliff Aaand... "Passed bad arguments to DateTime somehow 23:02
in method <anon> at /home/cbwood/Projects/rakudobrew/versions/moar-blead/install/share/perl6/site/sources/BF8DC17C7D061DE407BA1FC82207D0F56C81DFEE (DateTime::Timezones) line 127"
raku -e 'use DateTime::Timezones; my $dt = DateTime.new(DateTime.new(1).offset + 1, timezone => DateTime.now.offset); $dt.gist.say; $dt.is-dst.say'
[Coke] sorry. :( 23:14
guifa Ooops
guifa will take a look
(it's my module)
Xliff guifa: No worries! 23:15
So... the way I see it is that a .new-local for DateTime would need to set the TZ FIRST, and then assign the value.
To set the TZ after the value is set will always resolve a value in the past for negative timezones. 23:16
guifa Xliff: so you're wanting the timezone to print out with 00:00 if the timezone is GMT? 23:31
Z is one of the standard ways to indicate "timezone offset of 0"
Xliff guifa: No. I want a way to create a DateTime value with .new that has the local timezone. 23:40
So DateTime.new(1) == 1/1/70 00:01 23:41
That's GMT
Try and get that value with TZ = -04:00
guifa Ah okay.
I'd probably use 23:43
m: say DateTime.new: 1, :timezone($*TZ)
camelia 1970-01-01T02:00:01+02:00
melezhik . 23:44
guifa by definition Raku uses the variable $*TZ, so unless you've overridden it in some way, it's gonna line up with your timezone