🦋 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:03 Doc_Holliwould left 00:05 neshpion left 00:06 neshpion joined 00:11 gnufr33dom joined 00:23 wamba left 00:46 squashable6 left 00:47 squashable6 joined 01:39 mowcat left 02:21 JRaspass left 02:39 kvw_5_ joined 02:42 kvw_5 left 03:04 Manifest0 left 03:06 Manifest0 joined 03:23 neshpion left 03:29 vike left 03:32 vike joined 03:42 shlomif2 is now known as rindolf 03:45 leont left 03:49 neshpion joined 03:52 neshpion left, neshpion joined 03:57 neshpion left 03:58 neshpion joined 04:00 vike left 04:30 epony left 04:31 vike joined 04:59 epony joined 05:24 gnufr33dom left 05:54 parabolize left 06:04 gnufr33dom joined 06:15 neshpion left 06:24 kaiwulf left 06:56 Doc_Holliwould joined 07:05 orinthe7 joined 07:08 orinthe left 07:09 orinthe joined 07:10 orinthe7 left 07:45 gnufr33dom left 08:00 berber44 joined 08:03 Doc_Holliwood joined 08:04 Doc_Holliwould left 08:11 aborazmeh joined 08:45 xinming_ left 08:47 xinming_ joined 08:58 pecastro joined 09:35 wamba joined 09:39 aborazmeh left 09:52 kerframil left 09:56 aborazmeh joined 09:57 aborazmeh left 10:00 aborazmeh joined 10:17 Sgeo left 10:26 berber44 left 10:29 cetjs2 left 10:32 Doc_Holliwood left 10:37 aborazmeh left 10:42 cetjs2 joined 10:43 cetjs2 left 10:59 lizmat left 11:01 lizmat joined 11:14 aborazmeh joined 11:40 aborazmeh left 11:45 aborazmeh joined 11:55 squashable6 left 11:56 squashable6 joined 12:09 gnufr33dom joined 12:15 berber44 joined 12:19 leont joined 12:22 berber44 left 12:32 aborazmeh left 12:51 cetjs2 joined 13:05 patrickb joined 13:22 mowcat joined 13:26 wamba left
gfldex lolibloggedalittle: gfldex.wordpress.com/2021/02/28/un...ape-hatch/ 13:30
13:40 JRaspass joined 13:43 aborazmeh joined 13:45 gnufr33dom left 14:09 mowcat left 14:11 lizmat left 14:12 lizmat joined
codesections gfldex: I don't think that's really _undocumented_ (though I'm sure it could be clearer). But the docs say that `given` is a statement and, in general, statements don't return a value -- but they *do* return a value when preceded by `do`, when wrapped in parentheses, or when they are the final element in a block. 14:46
m: sub f() { my $a = 42 }; say f 14:47
camelia 42
14:51 wamba joined 14:59 sxmx left 15:04 kaiwulf joined 15:13 sxmx joined 15:18 parabolize joined 15:19 stoned75 joined 16:19 greppable6 left, shareable6 left, sourceable6 left, releasable6 left, bisectable6 left, bloatable6 left, unicodable6 left, benchable6 left, statisfiable6 left, coverable6 left, tellable6 left, evalable6 left, quotable6 left, committable6 left, notable6 left, nativecallable6 left, squashable6 left, linkable6 left 16:20 squashable6 joined, benchable6 joined, linkable6 joined, nativecallable6 joined, releasable6 joined, notable6 joined 16:21 bloatable6 joined, shareable6 joined, committable6 joined, quotable6 joined, bisectable6 joined, unicodable6 joined, tellable6 joined, sourceable6 joined, statisfiable6 joined 16:22 greppable6 joined, coverable6 joined, evalable6 joined 17:12 mowcat joined 17:15 domidumont joined 17:19 gnufr33dom joined 17:22 berber44 joined 17:27 Kaeipi left 17:29 rindolf left 17:31 aborazmeh left
gfldex codesections: that succeed can return a value is undocumented. 17:33
17:33 berber44 left 17:35 aborazmeh joined 17:41 rindolf joined 17:49 brtastic joined 18:00 sena_kun left 18:07 sena_kun joined 18:18 brtastic left 18:23 Bucciarati joined 18:32 domidumont left 18:34 stoned75 left 18:44 stoned75 joined 18:47 Kaiepi joined 18:48 kaiwulf left 18:51 Doc_Holliwood joined, gnufr33dom left 19:07 sena_kun left 19:08 sena_kun joined 19:20 mowcat left 19:29 mowcat joined 19:39 aluaces left, aluaces joined 19:40 Sgeo joined
guifa vrurg: it’s really nice though 20:05
vrurg: what do you think should be the best approach, though, for role coercion where the role is fully stubbed? 20:06
For my rewrite of LanguageTag, I was wanting to heed someone’s request for a light version 20:08
so I was thinking doing a role LanguageTaggish with stubbed methods. Then I’d have my complete concrete implementation as class LanguageTag does LanguageTaggish. But there’d be a lightway role, role LanguageTag::Light does LanguageTaggish that could be applied to strings that would calculate the methods on the fly (trading creation speed/memory footprint for slower method calls). 20:11
given a signature \(LanguageTaggish() $tag), how do you think I should best handle that circular dependency? I could probably do the LanguageTaggish and the ::Light in one file, but the purist in me wants them in separate files ha 20:12
20:28 lizmat left 20:30 lizmat joined
guifa codesections: oooh, I just found something potentially dangerous with does vs but 20:30
well, s/dangerous/performance killing
Role A { method a { ‘a’ } }; my @a; @a.push: ‘foo’ but A for ^100; say @a.tail.WHAT 20:31
m: Role A { method a { ‘a’ } }; my @a; @a.push: ‘foo’ but A for ^100; say @a.tail.WHAT 20:32
camelia 5===SORRY!5===
Undeclared names:
A used at line 1
Role used at line 1

Other potential difficulties:
Useless declaration of a has-scoped method in mainline (did you mean 'my method a'?)
at <tmp>:1
------> 3Role…
guifa m: role A { method a { ‘a’ } }; my @a; @a.push: ‘foo’ but A for ^100; say @a.tail.WHAT
camelia (Str+{A})
20:32 aborazmeh left
guifa m: role A { method a { ‘a’ } }; my @a; @a.push: ‘foo’ does A for ^100; say @a.tail.WHAT 20:33
camelia (Str+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A…
guifa even WORSE
(I’m guessing because strings are valuetypes and roles don’t affect that) 20:34
m: role A { method a { ‘a’ } }; my @a; @a.push: ‘foo’ does A for ^100; say ‘foo’.WHAT
camelia (Str+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A}+{A…
perry AAAAA 20:37
20:47 patrickb left
vrurg guifa: you're trying to fit too much into too short sentence, perhaps. :) I don't see a circular dependency in your case but rather a clear tree with LanguageTaggish been the root and two branches. 20:53
guifa vrurg: sorry! I’m know for being long-winded 20:54
20:55 JRaspass left, aborazmeh joined
vrurg so am I, no worries. But this is certainly the opposite case. I either overlooking an important details, or you didn't mention it. 20:55
guifa vrurg: I guess I’m concerned about LanguageTaggish.COERCE. Since the Taggish role is abstract, it’ll need to apply the Tag::Light role or create a Tag class object 20:56
20:58 xinming_ left
vrurg guifa: why `self.new` in `CORECT` won't work for you? 20:59
20:59 xinming_ joined
guifa because all of the relevant methods are stubbed, so it wouldn’t be a meaningful coercion 20:59
basically, this is what I have (simplified for only the language part) 21:00
role Taggish { method language { … } }; role Taggish::Light does Taggish { method language { self.Str.split(‘-‘)[0] }; class Tag does Taggish { has $.language }  21:01
vrurg Aha, this is what I miss...
Then there is no really good solution. There is no way for COERCE to know what to convert into. I'd stub it too and provide implementations by the consuming classes/roles. 21:03
But if you imply that by default LanguageTaggish coerces into ::Light then just import it run-time and use as ::('LanguageTaggish::Light').new 21:05
guifa That’s true. I’m just debating which one I prefer to be the default haha.
the “Light” is only light by memory footprint so far. `but` isn’t exactly super fast compared to creating even moderately objects 21:06
moderately complex objects
vrurg guifa: Actually, stubbing COERCE will not work as LanguageTaggish() would remain non-functional. So, only run-time import remains. 21:07
I would probably re-consider the model in a way to avoid LanguageTaggish() altogether. 21:08
guifa That’s also very fair. There are a few other language tag models other than BCP47, so I was trying to come up with a way that would conceptually play well with them 21:09
Maybe I could just make the TagLight a class that has a single string attribute (extremely fast to make and coerce back into a Str) instead of a role to apply to a Str 21:10
21:23 rindolf left 21:47 wamba left 22:10 aborazmeh left 22:21 aborazmeh joined 22:33 gnufr33dom joined 22:49 neshpion joined 23:07 dogbert11 joined, xinming_ left 23:08 xinming_ joined 23:10 dogbert17 left 23:24 xinming_ left 23:25 xinming_ joined 23:29 Discipulus left 23:30 aborazmeh left 23:48 kerframil joined 23:53 JRaspass joined