🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
wayland76 m: enum Bla (a => sub {}) 05:11
camelia Sub object coerced to string (please use .gist or .raku to do that)
in any type_declarator at /home/camelia/rakudo-m-inst-1/share/perl6/lib/Perl6/Grammar.moarvm line 1
wayland76 Was just checking if github.com/Raku/old-issue-tracker/issues/5818 has been fixed. That code generates a different error than it does on my local (which is an older Raku) 05:12
lizmat wayland76: the first part of that issue was easily fixed, the second part will be harder 10:22
github.com/rakudo/rakudo/commit/d0eb6c6f18
wayland76 I updated my docker image to rakudo-star:latest, and got: Cannot auto-generate a proto method for 'Int' in the setting 10:36
In the end I gave up on the enum though. 10:37
lizmat could you gist a stack trace ?
yeah, the enum case is gnarly
enums in general are gnarly
from an implementation PoV
wayland76 For testing on my local, I was just using: github.com/rakudo/rakudo/commit/d0eb6c6f18 10:38
Gah, sorry,
Using: raku -e 'enum Bla (a => sub {})' 10:39
(wrong paste-buffer on Linux :p )
lizmat that should be clean now?
wayland76 Is there a way I can turn that one-liner into having a gist stack trace?
lizmat --ll-exception ? 10:40
wayland76 lizmat: Which raku are you wanting the stack trace on? (Your options are: a) My local, (easy, but it's 2022.04), or b) the one in a docker container (easy, and it's currently 2024.05), or c) Something based on the commit you just pasted (is there a docker container I can use for that?) 10:42
(can confirm that stack trace works on my local, btw) 10:43
lizmat we're talking about "Cannot auto-generate a proto method for 'Int' in the setting" right ?
wayland76 Yep :) 10:44
lizmat which has nothing to do with the enum issue, right? 10:45
wayland76 On an unrelated note, if I've got a block of tests, and I've put in a plan for them, is there a way to say "This block of tests is done" before starting a new plan?
lizmat subtest ? 10:46
docs.raku.org/routine/subtest
wayland76 lizmat: I started out with the code at gist.github.com/wayland/cef503c293...f6cfa2e14a and got a very similar error. I'm thinking I need to restructure that code anyway, but that's where I started. 10:50
lizmat: subtest is just what I wanted. Thanks! :) 10:52
lizmat you might also be interested in docs.raku.org/routine/is%20test-assertion in that case 10:54
wayland76: perhaps describe what you're trying to achieve? 11:03
a ∪ infix op
I don't think you need to do a ∪= op, should that be generated the correct way automatically? 11:04
wayland76 Sorry. What I was trying to achieve (I've stopped now, but this is what I was aiming for): to be able to declare a FlagSet, which is a variable that's basically a bit array of the elements of the enum. And you're right, I probably don't need the ∪= op. 11:05
Anyway, feel free to stop working on problem arising from the the FlagSet thing for now as far as I'm concerned -- I may get back to it, but I've worked around it for now by using some booleans instead. 11:10
lizmat ack, will return to my regularly scheduled programming now :-) 11:11
wayland76 ack, indeed ( beyondgrep.com/ ) :p 11:16
wayland76 Thanks for your help, but in this case, I figured you have better things to do for the Raku community :) 11:16
lizmat I'll put --not on my list for App::Rak :-) 11:19
wayland76 If you like. I was just linking to it because it was the site for ack :) 11:20
wayland76 Can I declare an attribute that will contain an object, but throw an error if that object can't do a specified role? 11:24
wayland76 Oh, looks like if you have two modules that include each other, it's an infinite loop :) 11:26
lizmat wayland76: declare the attribute for that role ? 11:29
wayland76 Will doing that also accept subclasses of that role? 11:30
lizmat yes 11:32
wayland76 Great! When I solve the recursive use issue, I'll do that :) 11:39
lizmat weird that it's infinilooping 11:46
should get something like: Circular module loading detected trying to precompile
even if the circularity is something like A -> B -> C -> a 11:48
even if the circularity is something like A -> B -> C -> A
[Coke] wonders how there can be financial services companies that require emails but DO NOT VERIFY THEM. 14:46
(I have a vanity domain very similar to an indian consulting company and their employees often sign up for stuff with *my* domain, and I get emails with info in them. it's crazy) 14:47
[Coke] for math stuff, should docs link to wikipedia? Anyone wish to suggest a better maths source? 15:29
e.g. en.wikipedia.org/wiki/Miller%E2%80...ality_test 15:30
Guest84 Problem with types in sub signature. I have two small functions (here: gist.github.com/nd3i/86b89bc396515...803e2248). Works fine without specifying any types for the args or return; I can chain the functions, no prob. If I naively specify the types, chaining fails (see the session output in the gist). So any hints appreciated, but 16:41
the bigger problem is that I (clearly) don't understand raku's type language, so tips on fixing that would be even better. TIA
lizmat the % sigil implies "Associative" 16:46
Hash %cp 16:47
specifies a hash of hashes
either remove the "Hash" or use the $ sigil 16:49
Guest84 ^^
Guest84 Ok, makes sense. Let me digest that a bit. THX!
Guest84 So, Hash $cp ... works if I also tweak the 'for' to use %$cp 16:55
lizmat yes, indeed... but why the "Hash"? 16:56
do you really want to limit to Hashes ? no Maps, no other classes that do the Associative role ? 16:57
the % indicates all that for you
Guest84 'defensive' programming? Fully specifying types looks 'professional' (I've no idea what I'm doing of course) 16:58
Never thought about what other types might be handy. 16:59
lizmat defensive programming is ok: using % as a sigil is just that
m: sub a(%foo) { dd }; a(42) 17:00
camelia ===SORRY!=== Error while compiling <tmp>
Calling a(Int) will never work with declared signature (%foo)
at <tmp>:1
------> sub a(%foo) { dd }; ⏏a(42)
Guest84 Of course. Point taken. 17:04
guifa Ugh, I have a feeling my TPRC talks may have been lost 18:34
guifa Might be an excuse to regive them at London ha 18:34
lizmat guifa: yeah , very disappointing :-( 18:42
where the Raku presentations in a different room from the others by any chance? 18:43
guifa Generally yes, but some of the talks were presented
My two talks were back to back though, so if there was any issue, would have hit both of them
lizmat I guess Bruce's talk was presented rather than prerecorded ? 18:44
guifa Yeah, everyone was in person for Raku
lizmat right
guifa Was cool getting to meet some Raku folk in person I hadn't seen though so I count it as a win either way 18:46
thowe Wish I could have gone :( 19:44
I hope it is that close to me again. Was the venue good?
guifa I mean, it worked :) it's one of the less flashy hotels and that's not a bad thing (price was good) 20:09
thowe I've been looking at some of the talks. The one about PDF::Data was very relevant to me. I emailed the guy. 21:27
guifa He was cool! I missed his talk because mine was concurrent with his 21:47
[Coke] is sorry his travel plans got Delta'd! 21:59