🦋 Welcome to the former MAIN() IRC channel of the Raku Programming Language (raku.org). This channel has moved to Libera (irc.libera.chat #raku)
Set by lizmat on 23 May 2021.
00:02 reportable6 left 00:05 reportable6 joined 00:21 holly_ joined 00:27 domattps is now known as GoneDomattps 01:07 GoneDomattps is now known as domattps 01:28 holly_ left 01:54 guifa joined 02:12 silug left, silug joined 02:44 domattps is now known as GoneDomattps 02:50 GoneDomattps is now known as domattps 03:06 RandalSchwartz left 03:17 Maylay left 03:22 Maylay joined 03:38 domattps is now known as GoneDomattps
tonyo i never know if he's gone. 03:56
03:56 Maylay left 04:14 Maylay joined 04:39 nebuchadnezzar joined
moon-child I know it's been discussed to death already, but I still find it somewhat irksome that this is intended behaviour 04:51
m: sub infix:«<>»(Int $a, Int $b) { $a != $b }; say (5|6) <> (6|8); say (5|6) != (6|8);
camelia any(any(True, True), any(False, True))
05:27 RandalSchwartz joined 05:46 jmcgnh left 06:02 reportable6 left 06:05 reportable6 joined, jmcgnh joined 06:08 ufobat__ joined 06:17 bdju left
Geth doc: b80ace8118 | rir++ (committed by Juan Julián Merelo Guervós) | doc/Language/regexes.pod6
Update regexes.pod6

Change "two vowels together after a C<:>" to "multiple characters after a C<:>".
Both 'vowels' and 'two' are too restrictive.
linkable6 Link: docs.raku.org/language/regexes
06:18 bdju joined
Geth doc: 4b25dbbc7d | (Stoned Elipot)++ (committed by Juan Julián Merelo Guervós) | 2 files
Document Str.samecase

  ... and state that Cool.samecase uses it.
doc: 9e382bc0c2 | (Stoned Elipot)++ (committed by Juan Julián Merelo Guervós) | 2 files
Add Real.{Int,Num,Rat} coercers ref #3782

  ... and remove non-existent Numeric.{Int,Num,Real} ones
doc: acd9065d3f | (Stoned Elipot)++ (committed by Juan Julián Merelo Guervós) | doc/Type/Real.pod6
Avoid repetitions
06:19 linkable6 left 06:20 linkable6 joined 06:42 stoned75 left 06:43 stoned75 joined 07:22 Sgeo left 07:26 doconthe1ocks joined 07:30 patrickb joined
lizmat clickbaits rakudoweekly.blog/2021/06/14/2021-24-missing/ 07:39
moon-child clicks
07:45 dolmen joined 07:52 dakkar joined 07:53 patrickb left
moon-child m: say -1 .abs 08:12
camelia 1
moon-child m: say 1/2 .numerator
camelia No such method 'numerator' for invocant of type 'Int'. Did you mean
in block <unit> at <tmp> line 1
lizmat that feels weird 08:13
m: my $a = 1/2; say $a .denominator # feels like some kind of parsing issue 08:14
camelia 2
moon-child it's parsing as 1 / (2.numerator) 08:15
(I assume--)
lizmat m: dd 1 + 4 .Str # looks like it's more general 08:17
camelia 5
lizmat note that that's an Int, not a Str 08:19
moon-child m: dd ~5 .Int 08:20
camelia 5
lizmat yeah, so prefix ops bind tighter
moon-child for some reason I had assumed that it was special-cased for prefix - and /, so you could call methods on negative numbers and rats with less noise. But the more I think about it the less sense that makes 08:21
*and infix /
08:27 nebuchadnezzar left 08:32 peder left, peder joined 08:33 peder left, peder joined 08:35 peder is now known as pstray 08:36 pstray is now known as peder 08:47 RandalSchwartz left 09:31 dogbert11 left 09:38 sono left 10:38 linkable6 left, evalable6 left 10:39 evalable6 joined 10:40 linkable6 joined
Geth doc: 8335be8cf5 | (Stoned Elipot)++ | doc/Language/101-basics.pod6
Add (missing) whitespaces

  ... or else the spell test (xt/aspell.t) fails
linkable6 Link: docs.raku.org/language/101-basics
Altreus I found myself in a wholesome discussion on r/raku about the use of reduce, and I learned that I'm getting things right without fully understanding them 10:53
This means that raku is behaving like I expect
I also learned that a thing I wanted is an option :D
lizmat :-) 10:55
/r/raku ?
Altreus er /r/rakulang isn't it
that seems right
11:02 morayj joined 11:19 adhsfsfgh joined
Geth doc: f6023dac67 | (Stoned Elipot)++ | 2 files
Switch to Doc::TypeGraph
11:45 dolmen left 12:03 reportable6 left, reportable6 joined 12:16 adhsfsfgh left 12:51 morayj left 13:25 morayj joined 13:53 morayj left 13:59 Sgeo joined 14:02 RandalSchwartz joined
Geth doc/num-str: c3de886399 | (Stoned Elipot)++ | doc/Type/Num.pod6
Document Num.Str
doc: stoned++ created pull request #3899:
Document Num.Str
14:23 Raycat|Work joined 14:26 Raycat|Work left 14:39 ufobat_ joined 14:41 [dpk] joined, dpk left 14:42 ufobat__ left 15:06 vrurg_ joined 15:07 vrurg left 15:10 Sgeo_ joined 15:15 Sgeo left 15:17 GreaseMonkey left 15:21 greaser|q joined 15:31 ribdro joined 15:33 dg left 15:35 morayj joined 15:37 dg joined 15:41 GoneDomattps is now known as domattps 15:48 [dpk] is now known as dpk 15:55 sftp left 16:22 sono joined 16:37 dakkar left, domattps is now known as GoneDomattps 16:45 GoneDomattps is now known as domattps 16:56 holly_ joined 16:58 Doc_Holliwood joined
Doc_Holliwood oi 16:58
if you remove the joins from my tweet here twitter.com/HrBollermann/status/14...6995890178
ah nevermind
ah nevermind 16:59
17:05 ufobat_ left 17:14 domattps is now known as GoneDomattps 17:16 GoneDomattps is now known as domattps 17:21 Tirifto left 17:22 Tirifto joined 17:26 domattps is now known as GoneDomattps 17:35 holly_ left 17:40 morayj left
Altreus OK I'm gonna be streaming some API::Discord dev tomorrow night against my better judgement 17:46
Excessive being smarter than me will be frowned upon
17:48 juanfra left 17:51 cbk joined
codesections ha. Altreus, if I ever do something like that, excessive-being-smarter-than-me will be *strongly encouraged* 17:53
Altreus no you see
I'm going to need some
17:53 juanfra joined
Altreus In fact quite a lot 17:53
The cup runneth dry
but you know, it is bad manners to make the streamer cry
codesections ha. (there's a "stream of tears" joke somewhere just out of my reach) 17:54
Altreus elusive humour 17:55
Anyway it'll be in 24 or 25 hours from now, depending on how I'm feeling
codesections cool
tonyo schrödinger's joke
Altreus heisenlol
that's enough IRC for today. TTFN 17:56
codesections It seems like the Raku take on "heisenlol" would be eigenlol, fwiw 17:58
18:02 reportable6 left 18:05 reportable6 joined 18:09 demostanis[m] left 18:15 stoned75 left 18:17 stoned75 joined 18:29 Henry151 joined 18:30 Henry151 left 18:31 greaser|q left, greaser|q joined, greaser|q is now known as GreaseMonkey 18:32 Henry151 joined
xinming releasable6: status 18:59
18:59 demostanis[m] joined
releasable6 xinming, Next release in ≈4 days and ≈0 hours. 1 blocker. 0 out of 17 commits logged 18:59
xinming, Details: gist.github.com/7e16dbcd4fee5b8cf4...2d2e70e404
19:03 Sgeo_ left, Sgeo joined 19:05 leah2 left, leah2 joined
codesections What's the syntax for a function that returns a function with a specified signature? 19:06
m: sub f(Int $a --> Callable:(--> Int)) {...} # doesn't work
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed return value (return constraints only allowed at the end of the signature)
at <tmp>:1
------> 3sub f(Int $a --> Callable7⏏5:(--> Int)) {...} # doesn't work
19:08 marekh joined 19:09 stoned75 left
xinming m: sub f (Int $a --> &code:(--> Int)) { ... } 19:14
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed return value
at <tmp>:1
------> 3sub f (Int $a -->7⏏5 &code:(--> Int)) { ... }
xinming m: sub f (Int $a --> &(--> Int)) { ... } 19:15
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed return value
at <tmp>:1
------> 3sub f (Int $a -->7⏏5 &(--> Int)) { ... }
codesections (That last one is the syntax I'd _like_ to be able to write) 19:18
xinming yea, I'm trying too, I want to know the answer too. 19:19
codesections sub f(Int $a --> Code where { $_ ~~ :(--> Int)}) {...} # maybe it's NYI? 19:20
m: sub f(Int $a --> Code where { $_ ~~ :(--> Int)}) {...} # maybe it's NYI?
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot do non-typename cases of type_constraint yet
at <tmp>:1
------> 3nt $a --> Code where { $_ ~~ :(--> Int)}7⏏5) {...} # maybe it's NYI?
xinming m: sub f (Int $a --> Code where .signatures ~~ :(Int) ) { ... } 19:22
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot do non-typename cases of type_constraint yet
at <tmp>:1
------> 3$a --> Code where .signatures ~~ :(Int) 7⏏5) { ... }
xinming yea, this is where I got too.
the answer
Can we see rakudo finish all these features before we die?
MasterDuke 99% sure it is implemented, i thought there was an example in the docs? 19:23
gfldex Do you intend to get 100 years old?
Raku is designed to be a moving target. 19:24
19:24 ufobat_ joined
codesections MasterDuke: I see examples for return types and for callables, but not for returned callables (though I'd love to be wrong!) 19:25
gfldex codesections: did you check Roast? 19:27
MasterDuke docs.raku.org/type/Signature#Const..._Callables the first example here isn't what you want?
19:27 lgtaube left
codesections No, that takes a callable &l with the signature :(Int:D --> Int:D) but doesn't constrain the type of the callable returned by &apply 19:28
gfldex: no -- good idea, though, checking now 19:29
19:32 stoned75 joined
codesections gfldex: From a quick look at Roast, I'm sticking with the idea that constraining the signature of a returned Callable is NYI – for one thing, constraining the signature of a Callable parameter is tested in "closure-parameters.t", and there's no similar .t for return values 19:36
gfldex codesections: this is a case of „Cannot do non-typename cases of type_constraint yet“ indeed 19:45
19:46 leedo joined 19:47 marekh left, GoneDomattps is now known as domattps, leedo left 19:48 leedo joined 19:59 lgtaube joined
gfldex codesections: you might be asking for a rabbit hole. One might return a callable that returns a callable. What do you do if it's callables all the way down? :-> 20:18
jdv insert a turtle 20:23
20:23 rypervenche left
jdv yawns 20:23
codesections m: my $world = "\c[TURTLE]" xx ∞; say $world[42] 20:28
camelia 🐢
codesections gfldex: more seriously, that doesn't seem like any more of a problem than other places where recursion could be infinite. Many of Raku's functional idioms seem to have been inspired by Haskell, and Haskell certainly supports (indeed, requires) specifying the type of a returned function 20:30
e.g. (in Haskell): curry :: ((a,b)->c) -> a->b->c 20:31
in (psudo) Raku: sub curry(&fn:(\a, \b --> Code) --> &(--> &(--> Code))) {...} 20:33
gfldex In Heskell the return type is part of dispatch, so you acutally need to nail returned functions down. Without proper macros creating functions and therefor signatures on the fly requires EVIL. So with the new macro system we might need checks in the returned subs signature. 20:34
codesections interesting. I don't really know Haskell, so I'm not 100% sure I followed. Are you saying that the Haskell version of the following (impossible-in-Raku) code would work? 20:37
m: multi f(--> Int) { 1 }; multi f(--> Str) { "one" }; my Str $a = f(); 20:38
camelia Ambiguous call to 'f(...)'; these signatures all match:
in block <unit> at <tmp> line 1
gfldex you got it
codesections So we could potentially get ^^^ that to work one day, post RakuAST? 20:39
gfldex No, Raku is to dynamic for that. 20:40
20:40 rypervenche joined
gfldex Also, there is Nil (and Failure). 20:41
Well, we might get custom dispatchers. So with a slang it might be possible. 20:46
moritz you have to be careful with that; dispatch happens based on the actual types at runtime, not just the declared types 20:50
you cannot do that with return dispatch, because you don't know the actual type in advance
I don't know how confusing it will be if the two dispatch criteria are subtly different though; maybe it's not as much of a problem as I imagine it to be 20:51
codesections even in current Raku, though, you can do something like: 20:53
m: multi f(--> Int) { 1 }; multi f(--> Str) { "one" }; my Str $a = &f.candidates.first({.of ~~ Str})()
camelia ( no output )
codesections m: multi f(--> Int) { 1 }; multi f(--> Str) { "one" }; my Str $a = &f.candidates.first({.of ~~ Str})(); dd $a
camelia Str $a = "one"
gfldex And there is your custom dispatch. 20:54
m: multi f(--> Int) { 1 }; multi f(--> Str) { fail("one") }; my Str $a = &f.candidates.first({.of ~~ Str})(); dd $a
camelia Earlier failure:
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1

Final error:
Type check failed in assignment to $a; expected Str but got Failure (Failure.new(exceptio...)
in block <unit> at <tmp> line 1
20:58 ufobat_ left
Geth doc/mu-perl: 7082554e2f | (Stoned Elipot)++ | doc/Type/Mu.pod6
Add Mu.perl back

  ... which may have been removed by mistake.
Make its documentation somewhat minimal.
doc/mu-perl: ac4e630c84 | (Stoned Elipot)++ | doc/Type/Mu.pod6
Use code formatting and link to routine documentation
doc: stoned++ created pull request #3900:
Add back Mu.perl and tweak Mu.raku
21:09 domattps is now known as GoneDomattps 21:16 cbk left 21:54 Voldenet joined, TonFTP joined 21:57 ribdro left 22:12 TonFTP left 22:52 yewscion_ joined 22:57 holly_ joined
holly_ I've just uploaded my first sound program, Soundn::Tina (needs to be debugged) 22:59
23:17 Doc_Holliwood left