🦋 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.
00:00 jmcgnh left 00:03 Guest3992 left
tbrowder antononcube: i have worked witha 00:09
ray tracing. would that help with the maze solution? 00:11
intersections of rays in a plane with known planar figures (curved or straight, connected or disconnected) 00:15
00:31 LainIwakura joined 00:35 LainIwakura left 00:54 jrjsmrtn joined 00:57 hvxgr joined 01:04 jmcgnh joined 01:07 ilogger2 joined 02:30 kylese left, kylese joined 03:12 jgaz_ left 03:15 kylese left, kylese joined
disbot7 <aruniecrisps> @jubilatious1_98524 here's what i wrote, note that it only works for one character glot.io/snippets/hea42gkiew 03:48
Voldenet sadly it's limited to what unicode knows to be decomposable 04:01
m: "ł".NFD.list[0].chr.say 04:02
camelia ł
Voldenet it's clearly l with a slash
disbot7 <aruniecrisps> @voldenet yeah I'm not sure why that is 04:06
<aruniecrisps> For my use case it works fine because that's just how the Indic languages work, they're all decomposable
Voldenet unicode in general loves theoretical linguistics, which is correct
but for practical ones you might want to use things like metacpan.org/pod/Text::Unidecode 04:07
though in general you can't translate unicode to ascii sadly, modules like above usually handle just a subset and do really wild stuff, like translating 十 to + 04:16
transliterating, even 04:17
04:33 lichtkind_ joined 04:36 lichtkind left
guifa the L with stroke doesn't really decompose because there's no equivalent diacritic 05:09
the stroke combining diacritics aren't actually the same thing so it's not a decomposition candidate
05:50 Aedil left
grondilu m: role R[::T] { has %.h{T} }; class A does R[Str] {} 05:59
camelia MoarVM panic: Memory allocation failed; could not allocate 131072 bytes
grondilu m: my %h{Str} = foo => "bar"; 06:01
camelia ( no output )
grondilu m: my %h{Str} = foo => "bar"; print %h
camelia foo bar
06:04 Aedil joined 06:35 dg left 08:10 atcroft left 08:17 guifa left
grondilu m: class A {has UInt $.n; method WHICH { $!n mod 13 } }; my %h; %h{A.new(n => 8)} = pi; %h{A.new(n => 21)} = e; put %h.keys' 09:01
camelia ===SORRY!=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> pi; %h{A.new(n => 21)} = e; put %h.keys<HERE>'
expecting any of:
infix
infix stopper
postfix
statement end
st…
grondilu m: class A {has UInt $.n; method WHICH { $!n mod 13 } }; my %h; %h{A.new(n => 8)} = pi; %h{A.new(n => 21)} = e; print %h.keys 09:02
camelia A<6456753517720> A<6456753517800>
grondilu isn't WHICH used for hashing?
m: class A {has UInt $.n; method WHICH { $!n mod 13 } }; print A.new(n => 8)} === A.new(n => 21) 09:03
camelia ===SORRY!=== Error while compiling <tmp>
Unexpected closing bracket
at <tmp>:1
------> CH { $!n mod 13 } }; print A.new(n => 8)<HERE>} === A.new(n => 21)
grondilu m: class A {has UInt $.n; method WHICH { $!n mod 13 } }; print A.new(n => 8) === A.new(n => 21)
camelia This type cannot unbox to a native string: P6opaque, Int
in block <unit> at <tmp> line 1
grondilu m: class A {has UInt $.n; method WHICH { ($!n mod 13).Str } }; print A.new(n => 8) === A.new(n => 21)
camelia True
grondilu m: class A {has UInt $.n; method WHICH { ($!n mod 13).Str } }; my %h; %h{A.new(n => 8)} = pi; %h{A.new(n => 21)} = e; print %h.keys 09:04
camelia A<2401834493080> A<2401834493160>
grondilu m: class A {has UInt $.n; method WHICH { ($!n mod 13).Str } }; my %h; %h{A.new(n => 8)} = pi; %h{A.new(n => 21)} = e; print %h.values 09:05
camelia 2.718281828459045 3.141592653589793
10:17 dg joined 10:22 Sgeo left 11:34 sibl joined 11:40 sibl left 11:41 sibl joined 11:46 sibl left 11:58 itaipu joined 12:00 sibl joined 12:31 sibl left 13:34 librasteve_ left 13:47 Aedil left 13:56 Aedil joined
disbot7 <antononcube> @tbrowder_04810 Here is an example of my description of doing "maze with words": 14:43
<antononcube> cdn.discordapp.com/attachments/633...43cc0&
<antononcube> BTW, the hexagonal maze makes "2026" look bullet ridden: 14:44
<antononcube> cdn.discordapp.com/attachments/633...63013&
<jubilatious1_98524> ~ % raku -e ' say NFKD("ł").map: *.uniname.raku;' ("LATIN SMALL LETTER L WITH STROKE") 15:15
<jubilatious1_98524> @Voldenet The "ł" character doesn't appear to be de-composable. 15:17
<jubilatious1_98524> (...looks like @guifa chimed in already). 15:20
15:54 nuno joined 16:09 nuno left 16:24 arkiuat joined
Voldenet jubilatious1_98524: I know and it's "theoretically correct" - it's different letter from l with a stroke 16:33
but if I wanted ascii representation, I would use l anyway
either way, it's just one example of how dumber replacement tables actually are better for the task 16:34
because unicode wasn't made for this
> role R[::T] { has %.h{T} }; class A does R[Str] {} 16:35
this suspiciously resembles github.com/rakudo/rakudo/issues/6056 - I bet it's similar to bug in instantiate_generic 16:36
m: role R[::T] { has %.h{T} }; # this is enough 16:37
camelia ( no output )
Voldenet …or not
nevermind, it's different after all
tbrowder what are you really trying to do with thy Unicode characters? why the need to deconstruct them? 18:21
Voldenet turn utf into ascii, it's a very common problem if you for example need to construct url out of text 18:32
or simply store ascii text in search, there's a lot of use cases for it
18:34 gfldex left 18:36 gfldex joined 19:13 arkiuat left 19:17 arkiuat joined
disbot7 <.landyacht.> Love these, it's difficult to find mazes that are somewhat of a challenge as an adult... used to draw them on the back of kids' menus when I was little, tried to make them as hard as I could :^) 19:43
<antononcube> Great! 🙂 19:45
<antononcube> @Rog You might like the "Applications" and "Neat examples" sections here: www.wolframcloud.com/obj/antononcu...Labyrinth/
<antononcube> I am not sure what Raku package should provied those random labyrinths / mazes. Maybe, something like "Acme::RandomMaze". 19:57
20:26 guifa joined 20:45 ACfromTX joined 20:46 ACfromTX is now known as atcroft, Sgeo joined
disbot7 <librasteve> @antononcube ++ 21:47
21:59 Aedil left 22:09 human-blip left 22:11 human-blip joined 22:29 itaipu left 23:21 arkiuat left 23:25 ShimmerFairy left 23:33 arkiuat joined 23:37 arkiuat left 23:43 tejr left 23:51 arkiuat joined 23:55 arkiuat left