🦋 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. |
|||
00:22
pecastro left
00:25
jmchael left
01:07
guifa left
01:16
essem joined
01:19
essem left
01:26
d0d0 joined
02:08
perigrin left,
dustinm`_ left,
perigrin joined
02:09
dustinm` joined
02:10
cxreg left,
bdju left
02:11
cxreg joined
02:16
bdju joined
02:19
lucasb left,
frost-lab joined
|
|||
raku-bridge | <theangryepicbanana> drinking game: for every bad practice you see here, take a shot: github.com/kanaka/mal/tree/master/impls/perl6 | 03:01 | |
<theangryepicbanana> (also, if that pinged someone on irc I'm sorry lol) | 03:02 | ||
03:19
linkable6 left,
evalable6 left
03:22
linkable6 joined,
evalable6 joined
03:35
xelxebar_ left,
xelxebar joined
|
|||
coldpress | anyone knows what "chain-associative" and "list-associative" are in section 17.1 of learnxinyminutes.com/docs/raku/? | 03:39 | |
03:44
aborazmeh joined,
aborazmeh left,
aborazmeh joined
|
|||
coldpress | I'm guessing chain-associative means ($p § $q) § ($q § $r), but why does the tutorial say list-associative is infix:<>? | 03:45 | |
leont | Chain associative is a < b < c | 03:48 | |
list associative is: a Z b Z c | 03:51 | ||
03:59
leont left
|
|||
guifa2 | coldpress: if something is chain associative, that means it handles two at a time | 04:00 | |
04:00
cpan-raku left
|
|||
guifa2 | most of the math operators are chain associative | 04:00 | |
2 + 3 + 4 + 5 is really ((2 + 3) + 4) + 5) | |||
04:01
cpan-raku joined,
cpan-raku left,
cpan-raku joined
|
|||
guifa2 | so the signature is ($a, $b), and in the above would be called three times, as (2,3), and then (5,4), and then (9,5) | 04:02 | |
errr | 04:03 | ||
my bad, I need to stop answering when I'm sleepy | 04:04 | ||
I'm not sure why the list associative says infix:<>, some of the listy ones include | or ^ | 04:06 | ||
coldpress | guifa2: right, (2,3), then (3,4), then (4,5), but how are these three partial results combined together? | 04:28 | |
I'd appreciate it if someone points me to a Wiki page that explains this | |||
because googling and searching in docs.raku.org gives me nothing | 04:29 | ||
04:31
clarjon1 left
|
|||
coldpress | oh wait, (5,4) and (9,5) both act on the partial results, right? How is chain-associative any different from left-associative, then? | 04:31 | |
guifa2 | Actually I feel like I remember there being a bug here that got fixed recently | 04:34 | |
04:37
d0d0 left
|
|||
guifa2 | yup | 04:37 | |
'twas | 04:38 | ||
github.com/rakudo/rakudo/issues/3370 | |||
m: sub infix:<chain> ($a, $b) is assoc('chain') { say "Chain($a vs $b)" }; 5 chain 4 chain 3 chain 2 chain 1; | 04:40 | ||
camelia | Chain(5 vs 4) Chain(4 vs 3) Chain(3 vs 2) Chain(2 vs 1) |
||
guifa2 | let me do some more testing | ||
CHain is designed mainly for truthy values only | 04:42 | ||
the partial results are reduced using and | 04:43 | ||
coldpress | alright, I finished reading that tutorial's section, and I'm pretty sure list-associative means: "associative whenever both arguments are a list" | ||
guifa2 | chain(5,4) and chain(4,3) and chain(3,2), etc | 04:44 | |
So if you want a result returned at the end, it'll only be the result from the final two that are evaluated | |||
list-associative means all arguments are grouped in a list | 04:45 | ||
coldpress | so list-associative is a special kind of chain-associative? | 04:46 | |
guifa2 | so using that § operand, if you do 1 § 2 § 3 § 4 § 5 § 6, it will create a list (1,2,3,4,5,6) and then pass that to sub infix:<§> (*@args) { … } | ||
While it wouldn't make a difference for something like + or *, an operator like | or & need to get allt he arguments at once | 04:48 | ||
otherwise you'd end up with all(all(all(1,2),3),4) instead of all(1,2,3,4) for & | 04:49 | ||
05:01
roguelazer left
05:06
roguelazer joined
05:08
aborazmeh left
05:11
aborazmeh joined,
aborazmeh left,
aborazmeh joined
05:18
brtastic joined
05:21
parabolize left
05:34
aborazmeh left
05:53
b2gills left
05:57
brtastic left
|
|||
notandinus | paste.debian.net/hidden/9f58cc10/ | 05:58 | |
how can i write ^ wihtout defining %entry? | |||
i want to push directly | |||
06:13
aborazmeh joined,
aborazmeh left,
aborazmeh joined
06:18
BenGoldberg left
06:19
ufobat joined
06:20
jmcgnh left
06:25
jmcgnh joined
06:28
squashable6 left
|
|||
guifa2 | notandinus: use %( … ) to define a Hash inline | 06:28 | |
push @instructions, %( instructions => .Str, executed => 0) | 06:29 | ||
06:30
squashable6 joined
06:35
[Coke] left
06:37
[Coke] joined,
[Coke] left,
[Coke] joined
06:40
jmerelo joined
|
|||
guifa2 waves at jmerelo | 06:41 | ||
notandinus | guifa2: i see, thanks | 06:56 | |
06:59
maggotbrain joined
07:00
sena_kun joined
|
|||
jmerelo | hey, guifa | 07:13 | |
tellable6 | 2020-12-07T19:58:45Z #raku <guifa> jmerelo: yeah, unless there’s anything else you see that needs work | ||
2020-12-07T21:54:30Z #raku <guifa> jmerelo I’ve uploaded it on WP. Not sure which day you wanted it for | |||
jmerelo | Already scheduled your article. | ||
guifa2 | yay | ||
jmerelo++ | |||
jmerelo | We're still a couple of articles short, but that would include mine | ||
so thanks! | |||
BTW. devroom CFP is open :-) | 07:14 | ||
guifa2 just did wrote a crazy for loop | |||
err, just wrote* | |||
for (@a Z @b) X (@c Z @d) X (@e Z @f) -> ($x, $y, $z) { … } | |||
I'm going to mark this one down for an example to use sometime | |||
jmerelo | Those are lots of X and Zs | 07:16 | |
guifa2 | imgur.com/a/tvnDcI0 | 07:17 | |
It's surprisingly legible | |||
notandinus | say i have a recursive function an di pass a big array to it, should i pass a pointer or somethng instead of the big array? | ||
it does not modify the array. | 07:19 | ||
guifa2 | subs in Raku don't default to copying values, they're what you'd call pass-by-reference in other languages by default | 07:20 | |
notandinus | i see, makes sense | 07:21 | |
guifa2 | if you want a copy though, you can do that | 07:23 | |
sub foo ( @a is copy ) | |||
coldpress | guifa2: I see, your explaining list-associativity with `all` was very clear. Thanks! | 07:25 | |
guifa2 | coldpress: np, sorry for my initial bad description. it's late (and yet I'm still awake for some reason lol) | 07:26 | |
jmerelo: if you need another article, let me know and tomorrow afternoon I can try to write up a quick one | 07:29 | ||
jmerelo | guifa2: don't worry, I think we'll do. Anyway if we do it's going to be towards the end of the period | 07:35 | |
guifa2 will probably write it up anyways, and if it's not needed, it'll be ready for next year ^_^ | |||
notandinus | can i specify optional return in function? like sub func ( --> Int, Bool (optional)) | 07:40 | |
jmerelo | notandinus: not as such. What I would do is to use a role that piggibacks on the Int. | ||
^piggi^piggy | |||
guifa2 | ( --> Int | Bool) | ||
Means the function can return either an Int or a Bool | 07:41 | ||
jmerelo | guifa2: Hum. Can you do that? Great. TIL something new... | ||
notandinus | i want either int or int + bool | ||
guifa2 | I'm fairly certain you can | ||
jmerelo | notandinus: then it's the piggybacking | ||
guifa2 | notandinus: you're wanting to return an Int or a List that contains an Int and a Bool? | ||
notandinus | hmm i see, i'll check what piggybacking is | 07:42 | |
guifa2: right | |||
guifa2 | I think that might be a bit too complicated to write inline, but you could do a subset | ||
jmerelo | Use whatever if you want to return a number, whatever but True if you want to return that. | ||
or whatever but false | |||
m: sub foo( Int $þ --> Int ) { return $þ but $þ == 3 }; say so foo( 5), so foo(3) | 07:44 | ||
camelia | FalseTrue | ||
notandinus | ah | ||
what is this 'so' thing? | 07:45 | ||
jmerelo | notandinus: Boolean context. Not really needed... | ||
m: sub foo( Int $þ --> Int ) { return $þ but $þ == 3 }; say foo( 5), foo(3) | 07:46 | ||
camelia | FalseTrue | ||
notandinus | actually that number contains useful information so i can't be doing `but $p == x` | ||
jmerelo | notandinus: the whole thing is returned. | ||
notandinus | m: sub foo( Int $p --> Int ) { return $p but True }; say foo( 5), foo(3) | 07:47 | |
camelia | 53 | ||
jmerelo | m: sub foo( Int $þ --> Int ) { return $þ but $þ == 3 }; say foo( 5).raku, foo(3).raku | ||
camelia | Bool::FalseBool::True | ||
guifa2 | notandinus you get both the number and the boolean | ||
You'd probably feel more comfortable doing this though, as it works more like other languages: | |||
jmerelo | notandinus: the value is used depending on the contest. | ||
guifa2 | subset Foo where Int | (Int, Bool); sub foo (--> Foo) { … } | ||
That will enforce you returning an Int, or (Int, Bool) | 07:48 | ||
notandinus | actually if i just do Int, Bool in signature and just m: $t = func(), it ignore the Bool | 07:49 | |
this piggybacking thing is nice, thanks | 07:50 | ||
i'll just share the code, a min | |||
are you doing advent of code thing? it's day 08 part 1 | 07:51 | ||
paste.debian.net/hidden/4d767bd1/ - here | |||
jmerelo | notandinus: no time... advent calendar is taking a lot of my free time. Good luck with that. | ||
notandinus | i see, thanks anyways, i'll just do the Bool thing then | 07:54 | |
guifa2 | my @instructions = (0); can just be my @instructions = 0; | 07:55 | |
Unlike most languages, a parentheses doesn't create a list | |||
notandinus | m: sub foo { return 87 but False; } say foo(); say so foo(); | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Strange text after block (missing semicolon or comma?) at <tmp>:1 ------> 3sub foo { return 87 but False; }7⏏5 say foo(); say so foo(); expecting any of: infix infix … |
||
guifa2 | m: sub foo { return 87 but False; }; say foo(); say so foo(); | ||
camelia | 87 False |
||
notandinus | ah thanks, guifa2 so how do i extract 87, False out of it? | 07:56 | |
without running it twice | |||
guifa2 | m: sub foo { return 87 but False }; my $bar = foo; say $bar; say so $bar | 07:57 | |
camelia | 87 False |
||
guifa2 | Just toss the result into a variable | ||
coldpress | nice, is that the aforementioned piggybacking? | ||
guifa2 | coldpress: yeah. Technical-ish term is a mixin | 07:58 | |
notandinus | oh i see, wait how is this possible? | ||
ihow is that int storing a bool? | |||
guifa2 | It's no longer just an Int | 07:59 | |
when you use "but" it literally merges the two together | |||
It will function as an Int ---- until something needs a boolean value, and then it will function as the boolean you passed it | |||
08:00
wamba joined
|
|||
coldpress | notandinus: code review: `"input".IO.lines` can just be `lines` | 08:00 | |
guifa2 | m: my $a = 'hello' but 10; say $a ~ "!"; say $a + 20; | ||
camelia | hello! Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5hello' (indicated by ⏏) in block <unit> at <tmp> line 1 |
||
guifa2 | err | ||
notandinus | coldpress: i see, thanks | 08:01 | |
coldpress | notandinus: you don't need to capture the entire regex <()>, for tokens `operation` and `argument` | ||
guifa2 | m: my $a = 'hello' but 10; say $a ~ "!"; say $a.Int + 20; | ||
camelia | hello! 30 |
||
08:01
argento joined
|
|||
notandinus | oh you men you can also mixin string and int? | 08:01 | |
guifa2 | you can mix any class onto any other class | ||
notandinus | coldpress: i see, i don't know much about regex | 08:02 | |
argento | whhy does `list-of-strings.map(* ~~ /foo/) doesn't return a list of `Match` ? | ||
notandinus | actaully i dont know anything about regex, what should i change it to? | ||
guifa2 | argento: it does: | 08:03 | |
m: say <aaa bbb ccc abb acc>.map(* ~~ /a/) | |||
camelia | (「a」 Nil Nil 「a」 「a」) | ||
coldpress | notandinus: you can just remove <()>, no other changes | ||
notandinus | i see, still works fine, ah so <> means to look at whole regex? | 08:04 | |
argento | guifa2: ok, except when it doesn't match | ||
guifa2 | map returns the result of * ~~ /a/ which is Nil on failed matches | ||
you can just grep for the defined values | |||
coldpress | notandinus: <()> specifies which part of the matched regex is captured | ||
guifa2 | m: say <aaa bbb ccc abb acc>.map(* ~~ /a/).grep: *.defined | ||
camelia | (「a」 「a」 「a」) | ||
guifa2 is afk& | 08:05 | ||
notandinus | coldpress: i see, makes sense, i'll read up on regexes | 08:09 | |
08:11
guifa2 left
08:16
domidumont joined
08:27
dakkar joined
|
|||
argento | is it possible to chain functional operators like: `foo.map: *.some .map: *.other` or I must use `foo.map({$_.some}).map: *.other` ? | 08:31 | |
moritz | argento: how about foo.map: *.some.other | 08:33 | |
I think you can use ==> to chain maps without using parenthesis, but you'd have to look it up | 08:34 | ||
argento | moritz: Thanks, I'll check that out | ||
moritz | docs.raku.org/routine/==%3E | ||
moon-child | foo ==> map(*.some) ==> map(*.other) | 08:35 | |
but I agree that just foo.map: *.some.other is better for the specific case where you have two maps in a row | |||
argento | b.c the first op is * ~~ /foo/ and the second is *.hash | 08:36 | |
But thanks for the input | |||
moon-child | foo.map((* ~~ /foo/).hash) ? | ||
(funny, I remember some work in the haskell compiler to be able to turn a sequence of two maps into a single map. Though of course that optimization only works when your functions are pure.) | 08:37 | ||
argento | moon-child: makes sense :-), still learning | 08:38 | |
08:40
stoned75 joined
|
|||
moon-child | I am too. Skill ceiling on raku is suuuper high, and I'm only on step 2 or so ;) | 08:40 | |
08:58
domidumont left
09:00
domidumont joined
09:04
domidumont left
09:07
Altai-man joined
09:09
BenGoldberg joined
09:10
sena_kun left,
Sgeo left
|
|||
notandinus | how do i interchange stngs? say if its 'test' then change it to 'not-test' and vice versa? | 09:18 | |
09:18
domidumont joined
|
|||
coldpress | is it normal for .deepcopy(-> $c is copy {$c}) to give this `fd > STDERR_FILENO` error? 0x0.st/iheU.txt | 09:20 | |
09:21
argento left
09:23
asymptotically joined
|
|||
MasterDuke | coldpress: what are you copying? | 09:25 | |
09:26
patrickb joined
09:27
pecastro joined
09:28
aborazmeh left
09:40
patrickb left
09:42
BenGoldberg left
09:46
guifa2 joined
09:51
guifa2 left
10:01
guifa2 joined
10:12
Xliff joined
|
|||
Xliff | Hiyo! | 10:13 | |
What's the best way to get $_ of the outside scope? | |||
$OUTER::_ doesn't work. :) | |||
guifa2 | OUTER::<$_> should do it | 10:17 | |
MasterDuke | m: for ^3 { for "a".."c" { say OUTER::<$_>; say $OUTER::_ } } | 10:19 | |
camelia | 0 0 0 0 0 0 1 1 1 1 1 1 2 2 2 2 2 2 |
||
lizmat | OUTER is lexical, you probably want CALLER:: | 10:31 | |
but please note that these come at serious performance issues, and may actually become illegal at some point in the future | 10:32 | ||
guifa2 | lizmat: I noticed that between .c and .d, $_ was made undynamic | 10:33 | |
Which was sad days for me and some ideas I had lol | |||
lizmat | yeah... for me as well, as it will break a lot of the P5xxx modules of mine | 10:34 | |
but such is progress... | |||
guifa2 | the only trouble with removing CALLER:: is one situation I came across | ||
dynamic variables in recursives | 10:35 | ||
Geth | ¦ doc: MorayJ self-unassigned The whole explanation for the difference between block and closure is LTA github.com/Raku/doc/issues/3670 | 10:38 | |
lizmat | guifa2: but if a variable is marked as dynamic, it *will* be visible with CALLER:: | 10:44 | |
guifa2 | Ah I thought you were saying that CALLER:: might be removed | 10:45 | |
guifa2 did a pikachu face at that idea | |||
lizmat | sorry if I wasn't clear... being able to do a lookup of $_ from caller scope, will probably become impossible | 10:53 | |
guifa2 | one nice thing I found out earlier today | 11:00 | |
if you have descriptive (aka long) class names, using trust is really annoying | |||
self!MyReallyDescriptiveClassName::it-also-has-a-long-method-name( … ) | 11:01 | ||
You can do constant Friend = MyReallyDescriptiveClassName and then use self!Friend::foo-bar-xyz(…) | 11:02 | ||
err not self, but $object-that-trusts-me.Friend::foo | 11:03 | ||
guifa2 has been up for 24hrs, sleep time& | 11:04 | ||
11:05
jmerelo left
11:16
Xliff left
11:27
guifa2 left
11:28
Black_Ribbon left
11:33
asymptotically left
11:38
asymptotically joined
|
|||
gfldex | lolibloggedalittle: gfldex.wordpress.com/2020/12/08/sp...on-return/ | 11:45 | |
11:47
frost-lab left
11:53
ufobat_ joined
11:56
ufobat left
|
|||
Geth | doc/ISSUE-3709: 13 commits pushed by (Jan Krňávek)++, (Stoned Elipot)++, (Moray Jones)++ review: github.com/Raku/doc/compare/e5be44...a48ba787cb |
12:16 | |
12:34
BenGoldberg joined
|
|||
coldpress | MasterDuke: sorry for the late reply, I'm copying an array with many elements, each element is a hash with only one Str key and one Int value. If I replace line 47 at git.zhengqunkoo.com/zhengqunkoo/ad.../8.raku#47 with instructions.deepcopy(-> $c is copy {$c}), I get the error 0x0.st/iheU.txt | 12:46 | |
the array has 641 elements | |||
s/deepcopy/deepmap/ | 12:47 | ||
MasterDuke | interesting, i can repro. something to do with lines() reading from stdin. doesn't happen if i change it to take a filename as an argument and read lines from it | 13:01 | |
13:08
BenGoldberg left,
sena_kun joined
13:09
Altai-man left
|
|||
tbrowder | hi, questions for advent authors: (1) what format do you use to write the article, (2) how do you convert that to the html for wordpress, and (3) if you choose non-default styling, how do you apply it into the recipe? thnx | 13:10 | |
my current recipe (new for me this year): write in raku pod, convert to html with Pod::To::Html, default styling so far. | 13:12 | ||
MasterDuke | coldpress: i'm not quite sure what's going on, some error in libuv when moarmv is running a garbage collection and trying to calculate rss | ||
13:12
MasterDuke left
|
|||
sena_kun | tbrowder, I usually wrote in markdown directly, then using the advent script to get an article with highlighting and pasting into raw wordpress editor. | 13:14 | |
tbrowder | thnx | ||
my problem with that is non-ascii unicode (emojis in particular). do you insert the chars directly or use hex or decimal char notation? | 13:17 | ||
by insert chars directly for me that would be copy/paste | 13:18 | ||
sena_kun | tbrowder, simple - I don't use non-ascii symbols. :) | 13:23 | |
Might not suit for everyone, though. | |||
13:25
leont joined
13:27
MasterDuke joined
|
|||
MasterDuke | coldpress: for now i'd suggest working around it by taking the filename as a parameter and reading lines from that, but i created a moarvm issue github.com/MoarVM/MoarVM/issues/1400 | 13:28 | |
tbrowder | for my calendar-making program i use DateTime heavily and need to convert integer values to month and weekday names and abbreviations. i would like to integrate module Date::Names to enable easy multilingual use, and that's pretty easy to do. HOWEVER: | 13:33 | |
it would be easier if i could define the Date::Names class as a DateTime child class. | 13:35 | ||
is that as easy as defining it as "class Date::Names is DateTime"? | 13:37 | ||
seems too easy, but i'll try it. | 13:39 | ||
13:40
b2gills joined
13:58
finsternis left
13:59
finsternis joined
14:07
yosik joined
14:09
stanrifkin joined
|
|||
stanrifkin | can someone make a chm file of the raku documentation. I don't know how to do that. | 14:09 | |
yosik | Hi, everyone, can I ask you a question? I want to make a subroutine that takes an array as its argument, but I get an error "Type check failed in binding to parameter '@arr'; expected Positional[Array] but got Array ([ array here ])". Here is a sample code that causes an error: paste.debian.net/1176073/. Can you help me? | 14:19 | |
MasterDuke | yosik: `Array @array` is an array or arrays | 14:21 | |
*of | |||
e.g., `Int @array` is an array of Ints | 14:22 | ||
the `@` sigil already means it's an array | |||
jdv79 | i had forgotten about the "curl:from<bin>" type dep - from memory there was a bunch of design chatter about it. is that "solid" now? | 14:34 | |
notandinus | i'm taking $A and $B in MAIN sub, how do i make them mutable? it says cannot assign to immutable value | 14:43 | |
do i just use := instead? | |||
dakkar | `is rw`? | ||
14:44
wamba left
|
|||
dakkar | no, `is copy`, sorry | 14:45 | |
apparently declaring a MAIN parameter `is rw` confuses the parser | |||
notandinus | ah i see, makes sense | 14:46 | |
dakkar | the program `sub MAIN($a is rw) { ... }` keeps complaining it doesn't get a positional, even when @*ARGS contains it | ||
dakkar submits bug | 14:47 | ||
oh, it's already there github.com/rakudo/rakudo/issues/3929 | |||
dakkar updates rakudo | |||
notandinus | so i have this hash and want to sort it by keys being Int, .sort sorts them by Str | 14:56 | |
how do i do that? | |||
MasterDuke | .sort(+*) | 14:57 | |
notandinus | hmm that returns: paste.debian.net/hidden/29fa1e1b/ | 14:59 | |
m: my %t = (14 => "hi", 3 => "bye"); say %t.sort.raku; | 15:00 | ||
camelia | ("14" => "hi", "3" => "bye").Seq | ||
notandinus | m: my %t = (14 => "hi", 3 => "bye"); say %t.sort(+*).raku; | ||
camelia | Cannot resolve caller Numeric(Pair:D: ); none of these signatures match: (Mu:U \v: *%_) in block <unit> at <tmp> line 1 |
||
notandinus | yeah ^ | ||
MasterDuke | there are 'by' or 'with or 'as' arguments you want to use for sort then | 15:01 | |
notandinus | i see, i'll check it out, thanks | 15:02 | |
MasterDuke | m: my %t = (14 => "hi", 3 => "bye"); say %t.sort(+*.key).raku; | 15:03 | |
15:03
wamba joined
|
|||
camelia | ("3" => "bye", "14" => "hi").Seq | 15:03 | |
15:05
cpan-raku left
|
|||
notandinus | oh thanks, yeah i checked that page & looks like you can just do { .Int } | 15:06 | |
15:07
cpan-raku joined,
cpan-raku left,
cpan-raku joined
|
|||
notandinus | but that doesn't seem to work on hashes, i'll just use (+*.key) | 15:08 | |
MasterDuke | m: my %t = (14 => "hi", 3 => "bye"); say %t.sort(*.key.Int).raku; | ||
camelia | ("3" => "bye", "14" => "hi").Seq | ||
MasterDuke | m: my %t = (14 => "hi", 3 => "bye"); say %t.sort({.key.Int}).raku; | 15:09 | |
camelia | ("3" => "bye", "14" => "hi").Seq | ||
15:09
parabolize joined
|
|||
MasterDuke | you just need the .key | 15:09 | |
notandinus | ah, i was doing .Int.key | 15:10 | |
MasterDuke | m: my %t = (14 => "hi", 3 => "bye"); say %t.sort(*.value.chars).raku; | ||
camelia | ("14" => "hi", "3" => "bye").Seq | ||
notandinus | makes sense | 15:11 | |
MasterDuke | it's because .sort on a hash gives a list of Pairs | ||
m: my %t = (14 => "hi", 3 => "bye"); say %t.keys.sort(+*).raku; | 15:12 | ||
camelia | ("3", "14").Seq | ||
notandinus | is {.key} the same thing as *.key ? | ||
lizmat | semantically yes | ||
notandinus | hmm i see, makes senes | 15:14 | |
sense* | |||
15:20
guifa2 joined
15:21
Sgeo joined
15:29
wamba left
15:39
hh joined
15:40
hh left
15:59
BenGoldberg joined
16:00
stanrifkin left
16:08
BenGoldberg left,
BenGoldberg joined
16:14
morayj joined
16:19
RaycatWhoDat joined
|
|||
RaycatWhoDat | Howdy. Any web developers in here? Wondering why you chose to use this language and if it fits your workflow nicely. | 16:20 | |
codesections | I think of myself as primarily a web developer and have *plans* to use Raku for web projects, but haven't done so yet | 16:22 | |
(not counting processing Raku code/docs into formatted HTML for personal blog posts) | 16:24 | ||
16:28
yosik left
16:33
BenGoldberg left,
grondilu joined
|
|||
morayj | I've not gone very far with it - but it's familiar from Dancer which I was using before in perl (which is what brought me to Raku), but this is worth a look cro.services/ | 16:33 | |
codesections | yeah, cro is definitely the central component of the Raku web ecosystem | 16:35 | |
16:36
grondilu left
|
|||
tbrowder | whew, still having trouble accessing docs. i can get to raku.org, then docs from there. | 16:48 | |
then i can get to types ok | |||
from types i cannot get to date, but i can get to datetime or dateish | 16:49 | ||
codesections | tbrowder: that is very odd and troubling that it's lasted this long. I wish I could help -- but I'm not running into that issue and don't have any access to the docs site backend | 16:51 | |
[Coke] | what's the issue? | 16:52 | |
tbrowder | its funny because datetime and dateish are the only types so far that i can get to (i've checked many randomly, but not all) | ||
[Coke] | you could start at docs.raku.org or docs.raku.org/type.html search for Date or... | 16:53 | |
16:53
patrickb joined
|
|||
[Coke] | tbrowder: what issue are you having with the doc site? | 16:54 | |
tbrowder | i can't start on docs directly, but i'll try the search... | ||
codesections | [Coke]: the issue is about some pages (accessed in some ways) returning ERR_SSL_PROTOCOL_ERROR for tbrowder and RaycatWhoDat | 16:55 | |
tbrowder | when i go directly, my browser shows unsafe (chrome, safari) | ||
codesections | RaycatWhoDat: were you able to resolve that issue, or are you still running into it | 16:56 | |
? | |||
tbrowder | i can get to the types page by starting at raku.org, then click on documentation, then click on types | 16:57 | |
codesections | [Coke]: see colabti.org/irclogger/irclogger_lo...12-01#l546 for initial discussion | ||
Geth | doc/ISSUE-3709: 42936584d4 | (Moray Jones)++ | doc/Type/Slip.pod6 Fix slip example error |
||
doc/ISSUE-3709: 10c30eb641 | (Moray Jones)++ | doc/Type/Slip.pod6 Inserts example that doesn't break up Adds a non-breaking up example of slip in a subroutine Adds a method call that acts differently for comparison |
|||
RaycatWhoDat | codesections: I've been able to access the site recently. What was the cause? | 16:58 | |
tbrowder | on the types page i cannot get to the date type either by click or the search box: i get an unsafe msg from the browser | ||
codesections | we | 16:59 | |
[Coke] | tbrowder: have you tried in incognito? | ||
clearing cookies/cache, etc. | |||
codesections | RaycatWhoDat: we don't know -- I was hoping you had changed something on your end and could tell us :D | 17:00 | |
[Coke] | what browser are you using? what version? | ||
tbrowder | if we're using cro i think it is having trouble. jonathon told me the tls cert handling is a bit tricky | 17:01 | |
using chrome on ipad, but chrome and firefox on debian have same problems, but i'll go check in a bit.,, | 17:02 | ||
incognito same thing unsafe | 17:03 | ||
17:07
Altai-man joined,
jmerelo joined
|
|||
tbrowder | cleared cache, no help, going to check debian... | 17:07 | |
17:07
dataange` joined
17:08
dataangel left
|
|||
patrickb | nine: Can you elaborate a little what you are currently working on? I'm a bit confused by you calling off in-process precompilation vs all those new commits related to parallel compilation. (I am impressed by your work and am just wondering what you're up to...) | 17:08 | |
17:09
sena_kun left
|
|||
tbrowder | it's a bit erratic at first, but i can get to the date page. i'm convinced the dynamic nature of the website is the culprit, maybe a non-https cross-reference which is now a no-no with most browsers | 17:13 | |
[Coke] | .. the website is not dynamic. | ||
tbrowder | maybe links in css or other included code | 17:14 | |
[Coke] | unless there was recently a big change recently? | ||
tbrowder | don't know, how the docs are updated and published is a mystery to me | 17:15 | |
codesections | tbrowder: and something like that would impact everyone, not just you. I have accessed the docs site many times recently from multiple browsers and devices | ||
[Coke] | a static site is generated and that's what's served out. | ||
what *version* of browser are you on? | 17:16 | ||
I'm on Version 86.0.4240.198 (Official Build) (x86_64) | |||
(running on mac os x at the moment - not seeing any cert issues at all) | |||
tbrowder | which browser? | ||
Geth | doc: 9957486ab1 | (Moray Jones)++ (committed by Juan Julián Merelo Guervós) | doc/Type/Slip.pod6 Fix slip example error |
17:17 | |
doc: d59669f39b | (Moray Jones)++ (committed by Juan Julián Merelo Guervós) | doc/Type/Slip.pod6 Inserts example that doesn't break up Adds a non-breaking up example of slip in a subroutine Adds a method call that acts differently for comparison |
|||
linkable6 | Link: docs.raku.org/type/Slip | ||
codesections | it sounds more like a dns issue to me, and those are always a pain. Could be at the ISP level | ||
17:17
jmchael joined
|
|||
[Coke] | Chrome, sorry | 17:18 | |
RaycatWhoDat | I'm on Chrome 86.0.4240.198 and I'm checking the site now. Got in from DDG to the comb routine. | ||
[Coke] | tbrowder: what DNS provider are you using? your ISP or something specific like 8.8.8.8 or 9.9.9.9 ? | 17:19 | |
I'm using 9.9.9.9 here | 17:20 | ||
tbrowder | yeah, could be, i'll stop whining until i check with isp. my deb box is running off a different dns than incoming providing wireless. i usually set opendns but haven't check lately. thnx | 17:21 | |
nine | patrickb: the work on in-process precompilation exposed a couple of concurrency issues - places where we keep global state of the compiler which caused unwanted references to previous compilation units with in-process precompilation and all sorts of concurrency issues when having multiple threads EVAL | ||
jmerelo | tbrowder: they're updated by hand. | 17:22 | |
nine | patrickb: I've fixed the ones I knew about, but when testing those fixes discovered a couple more | ||
tbrowder | thnx, jj | ||
patrickb | nine: Ah. I understood. Thanks for clarifying! | 17:23 | |
rba | patrickb: rakubrew.org is back in business... | ||
tellable6 | 2020-12-07T07:54:04Z #raku-dev <patrickb> rba raku.org is down. Can you have a look? | ||
jmerelo | tbrowder: there's an alternative site which I use mainly for staging, rakudocs.github.io | ||
patrickb | rba thanks! | ||
tbrowder | jj, i'm having no issues with that at all! good to know as a fallback! | 17:25 | |
jmerelo | tbrowder: sometimes it's a couple of commits behind, but I always deploy there to check for any trouble. | 17:26 | |
tbrowder | btw, i hope to get advent article fixed by evening--using pod::to::html route... | 17:31 | |
17:35
maggotbrain left
|
|||
jmerelo | tbrowder: great ;-) Final slot filled in. Thanks! | 17:37 | |
17:38
dakkar left
17:50
skids joined
17:51
sftp left
17:54
sftp joined,
hal99999 joined
|
|||
leont | «No exception handler located for catch» (followed by a stacktrace directly into rakudo itself) is not the easiest error message to figure out | 18:04 | |
18:07
sftp left
|
|||
jmerelo | attending GitHub Universe now and asking about Perl & Raku support in codespaces. | 18:10 | |
18:11
morayj left
|
|||
leont | It appears something is returning a Failure, that turns into an Exception in a place that doesn't support exceptions | 18:12 | |
18:13
morayj joined,
ufobat_ left
18:17
sftp joined
18:19
wamba joined
|
|||
v_m_v | Hello. Could you explain me why this code: pastebin.com/8UEzbaxB is ~25% faster then this one: pastebin.com/s2csadL1 ? I have changed only one line (I have moved $number.sqrt.Int + 1 from "for" loop into variable) | 18:27 | |
jmerelo | v_m_v: there might be an error here? | 18:30 | |
m: my $number = 64; say 2 .. $number.sqrt.Int + 1 | |||
camelia | 2..9 | ||
jmerelo | hum, no, .. has is looser than + | 18:31 | |
leont | I don't think I can debug this without compiling custom raku's :-/ | ||
18:31
RaycatWhoDat left
|
|||
jmerelo | Only difference I can see is that you're using a native int in the second case. That's not a big difference in the overall thing, since it's not going into arithmetics | 18:32 | |
leont | I'm guessing it's spesh | ||
jmerelo | Once you turn it into a Range, it's no longer a native int, so no real difference there. | ||
leont | If spesh knows how to optimize a range, then this would make sense. No idea if it actually does. | ||
jmerelo | So I'm gonna go with spesh as leont | ||
leont: but the two ranges would actually be the same. | 18:33 | ||
So no idea | |||
leont | I guess if it knows it's an int, it can optimize it the same way it does for 2..42? | 18:39 | |
jmerelo | Well, comparisons might be a bit faster. But I'm not so totally sure native ints are carried over to Ranges. They might. | 18:40 | |
v_m_v | I see. The difference in time is about a couple of seconds (14.1s with variable and 19.7s with range). | 18:43 | |
jmerelo | v_m_v: I can't think of anything else here. Might definitely be the native thing. | 18:44 | |
18:47
domidumont left
|
|||
leont | If spesh manages to avoid the Range entirely, then it suddenly makes sense | 18:51 | |
Basically turn it into a C loop | |||
18:55
aindilis joined
18:57
sivoais left
19:03
hal99999 left
19:05
RaycatWhoDat joined
19:09
sftp left
19:10
hal99999 joined,
sftp joined
19:11
RaycatWhoDat left
19:24
BenGoldberg joined
19:31
guifa joined
19:35
avar left
19:36
avar joined,
avar left,
avar joined
19:42
morayj left,
aborazmeh joined,
aborazmeh left,
aborazmeh joined
19:43
RaycatWhoDat joined
19:48
RaycatWhoDat left
19:51
jmerelo left
19:52
leont left,
leont joined
19:56
Black_Ribbon joined
|
|||
guifa | gfldex++ for return-rw | 19:57 | |
19:58
BenGoldberg left
19:59
robinsmidsrod left
20:04
robinsmidsrod joined
20:05
sjm left
20:06
RaycatWhoDat joined
20:09
RaycatWhoDat left,
sjm_uk left
20:16
sjm joined
20:19
sjm left
20:20
sjm joined
20:25
aborazmeh left
20:46
grep0r joined
20:50
patrickb left
21:07
redhands joined
21:08
mowcat joined,
sena_kun joined
21:10
Altai-man left
21:14
stoned75 left
21:38
holli__ joined
21:42
Doc_Holliwould left
21:51
holli__ left,
holli__ joined
21:58
stoned75 joined
22:07
RaycatWhoDat joined
22:09
sena_kun left
22:24
imcsk8 left
22:25
imcsk8 joined
22:26
xelxebar left
22:27
grondilu joined,
xelxebar joined
|
|||
grondilu | SpaceX's new rocket about to launch : www.youtube.com/watch?v=zkfa5ebOcgM | 22:27 | |
22:29
HarmtH joined
|
|||
MasterDuke | isn't www.youtube.com/watch?v=nf83yzzme2I what you want? | 22:37 | |
grondilu | yeah, it's an abort. Sorry I know it's off topic. I thought you guys could have enjoyed watching this. | 22:38 | |
perryprog | No, thank you! | 22:39 | |
Off topic space links are always welcomed, everywhere. | |||
MasterDuke | oh, too bad. why the abort? | ||
grondilu | An engine detected a non-nominal state at the very last second. | 22:40 | |
feel free to join #space for more info | |||
22:41
stoned75 left
|
|||
jdv79 | it was supposed to happen hours ago... | 22:43 | |
22:47
ab5tract left
22:50
BenGoldberg joined
22:55
pierrot left,
pierrot joined
22:59
RaycatWhoDat left
23:02
moon-child left
|
|||
lizmat was watching... | 23:04 | ||
23:06
RaycatWhoDat joined
23:11
RaycatWhoDat left
|
|||
guifa2 pokes lizmat | 23:12 | ||
Is it possible to shape native arrays after declaration? | 23:13 | ||
(asking only because I know you recently did a lot of work on it) | |||
m: my str @foo; @foo = @[1,2,3]; | |||
camelia | This type cannot unbox to a native string: P6opaque, Int in block <unit> at <tmp> line 1 |
||
guifa2 | m: my str @foo; @foo = my str @[1,2,3]; | 23:14 | |
camelia | (signal SEGV) | ||
lizmat | interesting that one | ||
to answer the question: no | |||
the only thing you *could* do is wrap it into a sub | |||
sub shaper($size) { my int @shaped[$size] }; dd shaper(10); dd shaper(5) | 23:15 | ||
evalable6 | array[int].new(:shape(10,), [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) array[int].new(:shape(5,), [0, 0, 0, 0, 0]) |
23:16 | |
lizmat | but that would just be the same as having a shaped array in a sub where the size is determined by one of its parameters | ||
guifa2 | Yeah. In this case, the array is a class attribute, so I'll just do the old fashioned way with math haha | 23:18 | |
23:19
hal99999 left
23:20
wamba left
23:22
aluaces left
23:24
BenGoldberg left
23:25
dogbert17 left
23:31
grondilu left
23:37
fridim left
23:38
fridim joined
23:41
Celelibi left
|
|||
tbrowder | question on dates: how to find the first or second sun in a month? i'll give my solution first: | 23:47 | |
23:51
Celelibi joined
|
|||
tbrowder | use a DateTime obj and query first day of the month for its dow, then the first and second sundays are determined algebraicly from that based on 7 day per week | 23:52 | |
23:56
ab5tract joined
|