🦋 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:09 hungryd61 left 00:13 hungrydonkey joined 00:39 MilkmanDan left 00:49 JRaspass left, cpan-raku left 00:50 cpan-raku joined, cpan-raku left, cpan-raku joined 00:51 sena_kun joined 00:53 Altai-man left 01:09 Tirifto left 01:11 MilkmanDan joined 01:27 MilkmanDan left 02:00 MilkmanDan joined 02:34 Cabanossi left 02:43 Cabanossi joined 02:47 MilkmanDan left 02:49 MilkmanDan joined 02:55 sena_kun left
Geth advent: 47c574da12 | (Vadim Belman)++ | 20th/articles/rfc265.md
Add RFC 265
vrurg .seen jmerelo 02:57
tellable6 vrurg, I saw jmerelo 2020-08-16T17:00:18Z in #raku: <JJMerelo> lizmat I think I'm going to disable that. It never works...
03:25 ensamvarg left, ensamvarg joined 03:26 DarthGandalf left 03:27 unclechu left, AlexDaniel` left, DarthGandalf joined 03:28 MasterDuke left, matiaslina left 03:29 CIAvash left, Nasrudin left 03:30 dataangel left 03:31 mowotter joined 03:33 CIAvash joined, mowcat left 03:38 cusion joined 03:40 AlexDaniel` joined, unclechu joined, matiaslina joined, Nasrudin joined, mowotter left 03:44 cusion left 03:59 xinming left 04:01 xinming joined 04:44 Black_Ribbon left 04:45 Black_Ribbon joined 04:48 rockxloose left, xelxebar left, tejr left 04:51 xelxebar joined, rockxloose joined 04:53 tejr joined 04:57 hungrydonkey left 04:58 hungrydonkey joined 05:33 sjm_uk left 05:45 cpan-raku left 05:46 cpan-raku joined, cpan-raku left, cpan-raku joined, bocaneri joined 05:48 bocaneri is now known as Sauvin 05:51 hungryd16 joined, hungrydonkey left 05:55 sjm_uk joined 05:59 xelxebar left, tejr left, rockxloose left, terminatorul left 06:03 xelxebar joined 06:05 tejr joined, rockxloose joined 06:06 dolmen joined 06:12 rindolf joined, skids left 06:32 hungryd16 left, hungrydonkey joined 06:34 hungrydonkey left, hungryd6 joined 06:47 dolmen left, MasterDuke joined 06:53 stoned75 joined 06:59 patrickb joined
Geth ecosystem/master: 4 commits pushed by (Jack Kuan)++, (Juan Julián Merelo Guervós)++ 07:13
07:22 Sgeo left 07:33 jdv79 left, jdv79 joined 07:34 hungrydonkey joined, hungryd6 left
andrzejku Hello 07:38
07:49 dakkar joined 07:56 leont joined 08:07 MasterDuke left
SmokeMachine m: say "a b c\td e f\ng h i".words 08:11
camelia (a b c d e f g h i)
08:12 AlexDaniel` left, unclechu left, CIAvash left, matiaslina left, Nasrudin left 08:18 CIAvash joined 08:20 sno left 08:22 patrickb left 08:25 unclechu joined, AlexDaniel` joined, matiaslina joined, Nasrudin joined 08:32 finanalyst joined 08:35 sena_kun joined 08:51 Altai-man joined 08:52 sno joined 08:54 sena_kun left
SmokeMachine is there a way of finding the attributes a method uses on its body? 09:00
or only with RakuAST? 09:01
andrzejku do you think if Perl7 come it will eliminate Raku? 09:24
tadzik nah 09:27
not enough cool stuff in it :P
moritz perl7 still needs to solve all the problems that perl 5 has 09:36
[ptc] agrees with tadzik 09:37
moritz too easy to mix binary data and text; no good concurrency story; no function signatures; weak built-in OO etc. 09:38
09:45 mniip left 09:58 Black_Ribbon left 10:58 benchable6 left, quotable6 left, greppable6 left, coverable6 left, statisfiable6 left, reportable6 left, releasable6 left, bloatable6 left, unicodable6 left, bisectable6 left, linkable6 left, squashable6 left, committable6 left, shareable6 left, tellable6 left, sourceable6 left, evalable6 left, nativecallable6 left, notable6 left, releasable6 joined 10:59 coverable6 joined, sourceable6 joined, bisectable6 joined, benchable6 joined, greppable6 joined, quotable6 joined 11:00 unicodable6 joined, statisfiable6 joined, tellable6 joined, linkable6 joined 11:01 committable6 joined, nativecallable6 joined, squashable6 joined, evalable6 joined, notable6 joined, bloatable6 joined, reportable6 joined, shareable6 joined 11:14 sno left 11:24 AlexDaniel left 11:25 mniip joined 11:34 finanalyst left 11:37 stoned75 left 11:43 sno joined 11:56 justsomeguy joined 12:04 stoned75 joined 12:05 finanalyst joined 12:13 justsomeguy left 12:22 hungrydonkey left, hungrydonkey joined
[Coke] is there a way in comma to check for a newer version? 12:44
Altai-man [Coke], you mean plugin or standalone? 12:46
[Coke] the "complete" edition
"comma CP" 12:47
Altai-man Well, there is complete edition as a plugin for other jetbrains IDE and as an standalone IDE.
[Coke] standalone
Altai-man But anyway, for the plugin I don't think there are ropes at all for it, and standalone Comma warns you there is a new version, or at least it should, yes. 12:48
[Coke] ah, check is always on? ok.
12:48 pmurias joined
[Coke] wonders if it is worth fighting to see if cro works on mac yet. :| 12:48
Altai-man Yeah.
pmurias andrzejku: Perl doing great would be awesome for Raku 12:49
Altai-man Well, no idea about cro. :S
pmurias andrzejku: it's not very likely that it's possible to incrementally evolve Perl (the language) into something as cool as Raku 12:51
moritz and the real question is, IMHO: since Perl 7 wants to be backwards incompatible with Perl 5, will there be a fork, and Perl 5 continued to be maintained? 12:52
12:52 sena_kun joined
moritz if so: I'd like to suggest that Perl 7 gets a new name, ideally not starting with "Perl" :-) 12:52
been there, done that
pmurias moritz: talked with mst (on #perl) and he was hoping the backward incompatibility will be stopped 12:53
12:53 Altai-man left
pmurias anyway aren't major versions supposed to be a bit incompatible nowadays? 12:54
moritz yes, and everybody struggles with that
[Coke] I am definitely interested to see how the p5 community deals with these questions 20 years after the last time we tried this. 12:55
moritz there were reports in October of 2018 that 62% of websites on the Internet were still using PHP5, even though it was scheduled to EOL at end of 2018 12:56
12:56 angelds joined
[Coke] I suspect they have an idea of certain things to avoid. 12:56
moritz hard to find more up-to-date numbers, but it seems that php5 -> php7 wasn't such a huge success in terms of adoption
python2 -> python3 ... do I need to say more?
codesections I really like Rust's "edition" approach (which actually shares a fair bit with how we use `use` with our letter versions)
pmurias moritz: aren't a lot of website unmaintained tho? 12:57
codesections namely, that Rust keeps binary compatibility but can have backwards-incompatable syntax changes 12:58
moritz pmurias: that's part of the problem
[Coke] read an article about the 5/7 switch where the author was concerned that if there wasn't a 'use v7' required, there would be problems with users trying to run 7 code in a 5 and getting unexpected results, which certainly sounded familiar. 12:59
codesections (which doesn't let you change *everything* but lets you change a lot. It's basically what we'd have had if the plans to have a p5 mode had panned out)
12:59 epony left 13:00 zacts joined
codesections coke: Yeah, I kind of think Racket had the right idea, by requiring all programs to start with `#lang Racket`. They can *always* change that 13:00
13:00 epony joined
[Coke] I'm only [Coke] because someone took coke - no worries. :) 13:01
moritz codesections: LOLCODE does even better, all programs start with "HAI 1.2" or so and such declare their version number
language version number, even
13:02 zacts left
codesections moritz: Somehow, I feel like we'd have better luck with the pitch "we should all learn from Racket" than with "we should all learn from LOLCODE" :D 13:02
moritz en.wikipedia.org/wiki/LOLCODE#Example_2 these examples always make me chuckle, and remind me of pmichaud++'s awesome talk where he gave rakudo (then perl6 on parrot) a LOLCODE backend :D 13:03
codesections For some reason, it reminds me of emojicode (which, now that I think about it, would be pretty trivial to implement in Raku) www.emojicode.org/ 13:04
[Coke] the lolcode looks really familiar and I wonder if I have commits in that repo 13:06
13:07 angelds left
codesections moritz: I'm legitimately jealous of the error handling in the Example 2 you linked. Handling errors like that (instead of with exceptions) is probably the biggest thing I miss when writing Raku 13:08
moritz time for LOLRAKU! :D 13:10
moritz is a bit jealous of python's "with" contextualizer 13:11
tadzik I wouldn't be surprised if Damian has already implemented it as a vim plugin or something :P
codesections LOLRAKU - slogan: «-o LOLs» 13:12
pmurias tadzik: how are think with Warsaw.pm?
moritz likes it
tadzik pmurias: ded
not just because of the pandemic either
codesections tadzik: I don't understand how he can spend all day writing Raku and still find the inner willpower to drop back to Vimscript. Now *there's* a tough language to love! 13:13
pmurias the pandemic doesn't seem to be going anywhere soon :(
pmurias would attend a meeting but doesn't do anything Perl/Raku related anymore 13:16
tadzik I don't do much either. I think most Warsaw.pm member's don't 13:18
13:18 raku-bridge left, raku-bridge joined, raku-bridge left, raku-bridge joined
jdv79 NY.pm has fizzled as well 13:19
i think the last time we had regular meetings might have been 3 or 4 years ago 13:20
pmurias tadzik: this likely doesn't help the groups existence :( 13:23
tadzik pmurias: indeed:(
[Coke] Albany.pm is long gone. :| 13:24
codesections Have any of y'all gone to that SF online meetup? 13:28
13:28 pmurias left
moritz has been to some Germany.pm meetings 13:29
13:49 finanalyst left 14:12 sarna joined
sarna hey, I want all the arguments to MAIN to be required - is there an easy way for that? 14:13
apart from a chain of `unless $foo.defined`
codesections ! 14:15
jdv79 how does one exclaim nothing...
codesections m: sub f(:$named!) { say $named }; f
camelia Required named parameter 'named' not passed
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
codesections sarna ^^^ 14:16
jdv79 sarna: look at signatures and stuff in the docs?
sarna codesections: thanks!
jdv79: I searched for "required", nothing came up :(
jdv79 hmm, i guess it doesn't surface well - docs.raku.org/type/Signature#Optio..._arguments 14:18
sarna should've searched for "mandatory" :v 14:20
codesections :) 14:22
14:35 AlexDaniel joined, AlexDaniel left, AlexDaniel joined 14:38 sarna left 14:40 lustlife joined, lustlife left 15:04 MilkmanDan left, MilkmanDan joined 15:15 Sgeo joined
codesections This confuses me: 15:19
m: { POST { when ?True { False }}; 'foo'}
camelia WARNINGS for <tmp>:
Useless use of constant string "foo" in sink context (line 1)
codesections m: say { POST { when ?True { False }}; 'foo'}
camelia -> ;; $_? is raw = OUTER::<$_> { #`(Block|62789032) ... }
codesections grr
m: say { POST { when ?True { False }}; 'foo'}()
camelia foo
15:20 skids joined
codesections Why doesn't ^^^^ error? The POST condition is violated. Does `when` just not work with POST? Removing the (always true) `when` gets the error I wanted 15:20
m: say { POST { False }; 'foo'}() 15:21
camelia Postcondition '{ False }' failed
in block at <tmp> line 1
in block <unit> at <tmp> line 1
15:38 finanalyst joined 15:55 terminatorul joined 15:56 MasterDuke joined
tobs m: say do { POST { say "«$_»" }; 'foo' } 15:56
camelia «foo»
terminatorul Hello
tobs m: say do { POST { when "foo" { say "yay" } default { say "nay" } }; 'foo' } 15:57
camelia 5===SORRY!5=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> 3say do { POST { when "foo" { say "yay" }7⏏5 default { say "nay" } }; 'foo' }
tobs m: say do { POST { when "foo" { say "yay" }; default { say "nay" } }; 'foo' }
camelia yay
tobs it seems that when works as intended
codesections tobs: I think I actually figured that issue out, sort of: the `when` blocks in POST work as I expected, but only if you add an extra `{}` 15:58
tobs I'd say your use of `when $bool-literal` doesn't do what you think
codesections No, that's not it. Look:
m: say do { POST { when "foo" { say "yay"; False }; default { say "nay" } }; 'foo' } 15:59
camelia yay
codesections See, even though «yay» prints, the POST condition doesn't fail 16:00
m: say do { POST {{ when "foo" { say "yay"; False }; default { say "nay" } }}; 'foo' }
camelia yay
Postcondition '{{ when "foo" { say "yay"; False }; default { say "nay" } }}' failed
in block at <tmp> line 1
in block <unit> at <tmp> line 1
codesections But, with the extra block inside the POST, it works 16:01
Which I *think* is a bug (POST not treating itself as a block for when purposes). Do you agree?
tobs grmbl, it's certainly not nice. Normally a when block returns its last expression but something else (yes, probably POST) fails to pass that on. 16:04
I say as a complete layman
terminatorul Is there a way for me to `use SQL-Linux` on Linux, and `use SQL-Windows` on Windows (and `SQL-Mac` on Mac), in the same file ? And end up using the same symbols, but from the right module ? 16:08
tobs codesections: do you know `rakudo --target=ast`? If you want to get exposed to some internals and have some time to decipher the output, you could take a look at that. 16:09
terminatorul: the runtime version of `use` is called `require`. Determine the module name at runtime and then require the correct one. See docs.raku.org/language/modules#require 16:12
16:14 gnufr33dom left
tobs except I don't know how to do the importing of symbols that use does, after require 16:16
vrurg terminatorul: there is a module on modules.raku.org. Named 'if' or something like this. 16:25
Yep, it's 'if': github.com/FROGGS/p6-if 16:26
tobs: The right implementation of system dependency should use a proxy-module. In this case one doesn't need to import symbols, it'd be ok to re-export them from, say, sub EXPORT. 16:27
Just don't forget to return a Map instance from EXPORT, not a Hash. 16:28
16:36 dakkar left 16:40 stoned75 left 16:42 stoned75 joined 16:46 melezhik joined
melezhik .tell dwarring: I've added "patch" for LibXSLT - github.com/melezhik/RakuDist/commi...b8c95cb192 , now it successfully tests on RakuDist - rakudist.raku.org/sparky/report/debian/655 16:48
tellable6 melezhik, I'll pass your message to dwarring
melezhik I am not sure if dwarring: is in raku/irc, but just noticed that someone tried to test LibXSLT on RkDist, so I assume it could be him :-))) 16:49
16:51 Altai-man joined 16:53 sena_kun left 17:14 Noisytoot joined
terminatorul Thank you guys ! Can I find more about the proxy-module use ? 17:16
17:23 stoned75 left 17:27 stoned75 joined
vrurg terminatorul: proxy module is my term for a module which acts as a proxy for other modules. I.e. in your case it'd be SQL which would then load SQL::Linux or SQL::Windows and re-export their symbols. 17:31
terminatorul Is there no way to have the specific module resolved at compile time please ? 17:32
vrurg greppable6: sub EXPORT
greppable6 vrurg, 94 lines, 72 modules: gist.github.com/bec056f337ac012c65...d096f88036
vrurg terminatorul: see link to 'if' module above. 17:33
SmokeMachine m: role R[::T] is T {}; R[Int] # should this work? 17:37
camelia 5===SORRY!5=== Error while compiling <tmp>
T does not support inheritance, so R cannot inherit from it
at <tmp>:1
17:52 Black_Ribbon joined 18:05 melezhik left 18:09 MilkmanDan left, MilkmanDan joined
Geth ecosystem: fooist++ created pull request #526:
remove duplicate from META.list
18:22 Sauvin left
codesections m: constant $a = constant $b = 42; say $a; say $b; 18:34
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$b' is not declared
at <tmp>:1
------> 3tant $a = constant $b = 42; say $a; say 7⏏5$b;
codesections apparently chained assignment doesn't work with constants ^^^^ :( 18:35
(Not a big deal, but a slight inconsistency/paper cut)
18:44 guifa` joined 19:02 ChoppedBacon left 19:09 ChoppedBacon joined
guifa` codesections: did my answer on SO make sense? 19:29
19:31 MilkmanDan left
codesections guifa`: I _think_ so (and I just marked it as accepted) 19:31
I'd like to come back to it when I understand the internals a bit more/we have RakuAST
you said: «If your conditions are complex things like .is-prime and * %% 2, or even non-deterministic (smartmatching against a mutable object), it will either be difficult or impossible to know for sure.» 19:32
I don't _think_ that's right – or, at least, it seems like almost anything is Any
so the compiler could give up and make you handle all of Any
(in practice, that would mean requiring a `default {...}` case 19:33
guifa` What I mean is if the comparison value is subject to change 19:37
when Foo.status { ... }
I can't imagine why you would do it in that way, but if you do, the .status will vary
And might be different each time the given block is run 19:38
codesections but the point of checking for exhaustive matching is that you've handled all possible values allowed by the return type constraint on Foo.status
(which, if not specified would be Any) 19:39
guifa` Unless it returns a Mu ;-)
codesections well, fine :) but a `default` case would still handle that – it would just force you to have one, with the compiler there to remind you 19:40
(and, when you *have* constrained the return type of Foo.status, exhaustive pattern matching could be much more useful 19:41
guifa` I'd just use a default { die "WTF code needs fix kthxbye" } and save myself the trouble personally ;-)
guifa` actually uses that in one of his parses lol
codesections Like, maybe Foo.status returns a subset of Int that corrisponds to HTTP status codes that your code handles 19:42
19:42 sjm_uk left
codesections If you add a new code to the subset, you have to remember to add it to the given/when construct 19:42
guifa` You could probably create a special when clause, and feed it some type of information about what to expect 19:43
codesections and, if you forget and the status code is rare, you can end up with "WTF code needs fix kthxbye" errors in production :)
Yeah, that's kind of what I was thinking re: RakuAST. Or maybe it'd be a special type of `given` block? 19:44
guifa` err yeah, I meant givne block
so maybe
given-all $value, $range-description { … }
codesections Hmm, I still think it'd be possible to do without the $range-description 19:45
and just have it be based on $value.WHAT 19:46
guifa` You'd want the range to describe needing all positive ints, all reals, etc. Subsets aren't very introspectable 19:48
codesections «Subsets aren't very introspectable» is that a forever thing, or a NYI thing? 19:49
guifa` Subset constraints can include code of arbitrary complexity so... inasmuch as code can be introspected :-) 19:52
consider subset Positive of Int where * > 0 19:53
There's (a) currently no way (that I know) to grab the constraint (beyond being an Int), but (b) if you could, it's a WhateverCode, so you'd need to pull that through, piece together how it works and… complicated lol 19:55
codesections Perhaps I am under-thinking this (or ignoring huge performance issues), but why couldn't you just store the constraint as a string? 19:57
guifa` I mean you could
But what if the constraint is
where { $^i > 0 && $^i mod 8 < 4 && ($^i ** 3 - 1).is-prime } 19:58
codesections :m subset Ugly where { $^i > 0 && $^i mod 8 < 4 && ($^i ** 3 - 1).is-prime }; my Ugly $a = -1 20:00
m: subset Ugly where { $^i > 0 && $^i mod 8 < 4 && ($^i ** 3 - 1).is-prime }; my Ugly $a = -1
camelia Type check failed in assignment to $a; expected Ugly but got Int (-1)
in block <unit> at <tmp> line 1
codesections I'd rather that message be «Type check failed in assignment to $a; expected an Ugly where { $^i > 0 && $^i mod 8 < 4 && ($^i ** 3 - 1).is-prime } but got an Int (-1) 20:01
20:01 stoned75 left
guifa` Now *that* is one thing that where the error is LTA 20:01
codesections The current one, or the one I suggested :D 20:02
guifa` The current error message
codesections Yeah, that's all I meant by storing it as a string – which I know is just a minimum level of introspectability, but at least is something 20:03
20:08 Cabanossi left 20:13 stoned75 joined 20:15 Cabanossi joined 20:19 MilkmanDan joined 20:38 reach_satori_ left
rir Anything recommendedfor raku tidying, raku coverage, or counting lines of raku? 20:47
codesections I recall that there's a convention for declaring a multi with Bool flag that changes its behavior, but I can't find a concise way to declare it
something where the callsite usage is, e.g., `greet('tom') # OUTPUT «Hi, Tom»` and `greet('tom', :loud) # OUTPUT: «HI TOM!»` 20:49
MasterDuke rir: there's the MVM_COVERAGE_LOG=foo.log env variable to get a coverage report. there's modules.raku.org/dist/Perl6::Tidy:cpan:JGOFF for tidying, but i've never used it
20:50 finanalyst left
codesections But the only way that's occurring to me to declare that is with a signature like `multi greet($name, Bool :$loud where .so) {...}`, which seems far more verbose than what I recall seeing. What's the cleaner way to do it? 20:50
rir: I'm not familiar with anything, though I've also been currious 20:51
20:52 rindolf left, sena_kun joined 20:53 MilkmanDan left, Altai-man left
rir MasterDuke: Thanks, MVM_COVERAGE_LOG sounds promising. I got no joy from Perl6::Tidy. Or Perl6::Parser which seems, by docs, a precursor to a tidier. 20:55
codesections ^
MasterDuke rir: iirc, you want to do something like foo.%d.log so multiple processes don't stomp all over each other. maybe it's %p? and Perl6::(Tidy|Parser) have suffered from the loss of drforr, but hopefully somebody can step up and adopt them 20:57
21:01 stoned75 left
tobs codesections: maybe you saw `multi sub greet($name, :$loud!) { … }` but this candidate triggers when a loud named argument is mentioned, even if you pass `named => False`. The where clause using *.so is the only option I know at least. 21:02
*`loud => False`
21:03 terminatorul left
codesections rir: re: counting lines of Raku – the two lines-of-code counters I tend to use (tokei and loccount) both count Raku lines of code but – frustratingly - neither detect Raku properly based on file extension. It'd be an easy PR for either project, though 21:04
tobs: Thanks, I bet that was what I saw 21:05
guifa` You could probably avoid the Bool bit by just doing :$loud! where True
tobs I suppose a `subset Adverb of Bool where *.so; sub greet ($name, Adverb :$loud) { … }` could make it less noisy 21:06
guifa` tobs++
Re coverage: Comma has some coverage support for tests I believe, but I haven't used it yet
codesections guifa`: and it couldn't be `where True` because smartmatching
21:07 kensanata joined
guifa` I forgot about Boolean smartmatching being a bit unintuitive 21:07
tobs and if the subset is called Adverb it should be :$loudly, of course :)
codesections yeah, but at least the errors are clear
21:08 MilkmanDan joined
rir codesections: Thanks. I will check those out. 2 out of 3--line counter and coverage logger. Great! 21:10
codesections tobs: guifa: Oooh, I know, I'll just add `Bool % where *.values.so` as a constraint to the proto signature, and then be able to use :$loud! or similar in the multis 21:12
(that'll break if I add other named parameters, but that's fine) 21:13
21:18 Mawile joined 21:22 squashable6 left, squashable6 joined 21:26 guifa` left
rir guifa`: Thanks, I'll look at Comma. I've been mired in 'too much to learn' and forgot all about it. 21:26
tellable6 rir, I'll pass your message to guifa`
21:27 Mawile is now known as Archenoth 21:31 finanalyst joined 22:02 finanalyst left 22:03 kensanata left 22:23 mowcat joined
codesections m: role A[::T] {has T $.a; method a(-->T) {$!a}}; A[Int].new(a => 1).a 22:42
camelia Type check failed for return value; expected T but got Int (1)
in method a at <tmp> line 1
in block <unit> at <tmp> line 1
codesections Why does ^^^ die?
22:42 zostay left, kawaii left 22:43 mithaldu_ left, peteretep left, Grinnz left, spycrab0 left
codesections It looks like it's declaring the attribute $a to be of type T, and then asking for it back and guarenteeing that it's still of type T. But it's not a T anymore, somehow? 22:43
I think it's being wrapped in a Scalar, but I'm not sure why/how – and, oddly, adding `<>` to the method doesn't seem to help 22:44
This adds to my confusion here: 22:47
m: role A[::T] {has T $.a; method a() {dd $!a.VAR.WHAT; $!a}}; dd A[Int].new(a => 1).a.VAR.WHAT
camelia Scalar
22:48 spycrab0 joined
codesections It looks like $!a is a Scalar right _before_ it's returned, a Scalar _when_ it's returned (which is what caused the error before), but an Int as soon as it has been returned. 22:48
Is there some sort of auto-scalarization/de-scalarization going on here that I don't know about?
22:51 Grinnz joined, peteretep joined 22:54 mithaldu_ joined, kawaii joined
codesections Oh, wait, I just read camelia's error message and now I understand (in partial defense, I get a different msg in my local REPL). 22:56
22:56 zostay joined
codesections It's just that the T := Int binding doesn't last long enough for the return value check. I get it. 22:56
22:59 epony left 23:03 epony joined 23:12 aborazmeh joined, aborazmeh left, aborazmeh joined 23:14 MilkmanDan left 23:16 MilkmanDan joined 23:18 squashable6 left 23:19 squashable6 joined, squashable6 left 23:21 squashable6 joined 23:22 MilkmanDan left
[Coke] m: role A[::T] {has T $.a; method a(-->T) {$!a}}; A[Rat].new(a => 1).a 23:27
camelia Type check failed in assignment to $!a; expected Rat but got Int (1)
in block <unit> at <tmp> line 1
23:30 MasterDuke left 23:35 MilkmanDan joined
codesections m: role A[::T] {has T $.a; method a(-->T) {$!a}}; A[Rat].new(a => 1/1).a 23:56
camelia Type check failed for return value; expected T but got Rat (1.0)
in method a at <tmp> line 1
in block <unit> at <tmp> line 1
codesections (related: Why do I get the much less helpful error msg «Died with X::TypeCheck::Return» when I run that code locally? Odd) 23:57