🦋 Welcome to the main IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Logs can be inspected at colabti.org/irclogger/irclogger_log/raku
Set by lizmat on 21 April 2021.
00:05 kurahaupo left 00:13 kurahaupo joined 00:31 aborazmeh left
Xliff my $a = 0; my $s = '%sddd%s%s'; $s ~~ s:/'%s'/$a++/; $s.say 00:38
m: my $a = 0; my $s = '%sddd%s%s'; $s ~~ s:/'%s'/$a++/; $s.say
camelia 5===SORRY!5=== Error while compiling <tmp>
Colons may not be used to delimit quoting constructs
at <tmp>:1
------> 3my $a = 0; my $s = '%sddd%s%s'; $s ~~ s:7⏏5/'%s'/$a++/; $s.say
expecting any of:
colon pair (restricted…
00:38 gabiruh left
Xliff m: my $a = 0; my $s = '%sddd%s%s'; $s ~~ s:g/'%s'/$a++/; $s.say 00:38
camelia 0++ddd0++0++
Xliff m: my $a = 0; my $s = '%sddd%s%s'; $s ~~ s:g/'%s'/<{ $a++ }>/; $s.say 00:39
camelia <0>ddd<1><2>
00:39 gabiruh joined
Xliff m: my $a = 0; my $s = '%sddd%s%s'; $s ~~ s:g/'%s'/<{ $a++ }/; $s.say 00:39
camelia <0ddd<1<2
Xliff m: my $a = 0; my $s = '%sddd%s%s'; $s ~~ s:g/'%s'/{ $a++ }/; $s.say
camelia 0ddd12
Xliff m: my %a = 0; my $s = '%sddd%sddd%sdda%s'; $s ~~ s:g/'%s'/<{ %a{$0 // ''}++ }/; $s.say 00:42
camelia Odd number of elements found where hash initializer expected:
Only saw 1 element
in block <unit> at <tmp> line 1
Xliff m: my %a ; my $s = '%sddd%sddd%sdda%s'; $s ~~ s:g/'%s'/<{ %a{$0 // ''}++ }/; $s.say
camelia <0ddd<1ddd<2dda<3
Xliff m: my %a ; my $s = '%sddd%sddd%sdda%s'; $s ~~ s:g/'%s'/{ %a{$0} // ''}++ }/; $s.say
camelia Use of Nil in string context
++ }ddd++ }ddd++ }dda++ }
in block at <tmp> line 1
Use of Nil in string context
in block at <tmp> line 1
Use of Nil in string context
in block at <tmp> line 1
Use of Nil in string context
in bloc…
Xliff m: my %a ; my $s = '%sddd%sddd%sdda%s'; $s ~~ s:g/(\w+)?'%s'/{ %a{$0} // ''}++ }/; $s.say
camelia Use of Nil in string context
++ }++ }++ }++ }
in block at <tmp> line 1
Use of Nil in string context
in block at <tmp> line 1
Xliff m: my %a ; my $s = '%sddd%sddd%sdda%s'; $s ~~ s:g/(\w+)'%s'/{ %a{$0} // ''}++ }/; $s.say
camelia %++ }++ }++ }
Xliff m: my %a ; my $s = '%sddd%sddd%sdda%s'; $s ~~ s:g/(\w+)'%s'/{ %a{$0 // ''}++ }/; $s.say 00:43
camelia %000
Xliff m: my %a ; my $s = '%sddd%sddd%sdda%s'; $s ~~ s:g/(\w+)'%s'/$0{ %a{$0 // ''}++ }/; $s.say
camelia Use of Nil in string context
in code at <tmp> line 1
Use of Nil in string context
in code at <tmp> line 1
Use of Nil in string context
in code at <tmp> line 1
Xliff m: my %a ; my $s = '%sddd%sddd%sdda%s'; $s ~~ s:g/(\w+)'%s'/{ $0 }{ %a{$0 // ''}++ }/; $s.say
camelia %sddd0ddd0dda0
Xliff m: my %a ; my $s = '%sddd%sddd%sdda%s'; $s ~~ s:g/(\w+)?'%s'/{ $0 }{ %a{$0 // ''}++ }/; $s.say
camelia Use of Nil in string context
in code at <tmp> line 1
Xliff m: my %a ; my $s = '%sddd%sddd%sdda%s'; $s ~~ s:g/(\w+)?'%s'/{ $0 // ''}{ %a{$0 // ''}++ }/; $s.say 00:44
camelia 0ddd0ddd1dda0
Xliff m: my %a ; my $s = '%sddd%sddd%sdda%sddd%sddd%s'; $s ~~ s:g/(\w+)?'%s'/{ $0 // ''}{ %a{$0 // ''}++ }/; $s.say
camelia 0ddd0ddd1dda0ddd2ddd3
tonyo Xliff: give raku -e a shot 00:48
00:51 aborazmeh joined
Xliff Does raku have a "first" statement that will only run first time through a loop? 01:01
FIRST phased I think is too early.
moon-child what's wrong with FIRST? 01:04
m: for ^5 { FIRST { say "O $_" } say $_} 01:06
camelia 5===SORRY!5=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> 3for ^5 { FIRST { say "O $_" }7⏏5 say $_}
expecting any of:
infix stopper
moon-child m: for ^5 { FIRST { say "O $_" }; say $_}
camelia O 0
Xliff for ^5 { my $a = $_ + 1; FIRST { say "O $a" }; say $_} 01:09
m: for ^5 { my $a = $_ + 1; FIRST { say "O $a" }; say $_}
camelia Use of uninitialized value element of type Any in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
in block at <tmp> line 1
Xliff m: for ^5 { my $a = $_ + 1; FIRST { say "O { $a // 'undef'" }; say $_}
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3 $_ + 1; FIRST { say "O { $a // 'undef'7⏏5" }; say $_}
expecting any of:
infix stopper
statement end
Xliff m: for ^5 { my $a = $_ + 1; FIRST { say "O { $a // 'undef' }" }; say $_}
camelia O undef
Xliff ^^ That's my current problem.
japhb Xliff: (First approximation) Phasers are attached to blocks and fire at entry and exit, they don't happen at their location in the source code. 01:18
So a CATCH {} block for example could be at the start, middle, or end of a block, and work the same.
The approximation part is that there are phasers that are associated with the entire program or comp unit
Xliff japhb: Yes. I figured that bit out. 01:21
japhb: In the end, I just had to use a loop sentinel. It works, but I always think a High Level Language should know when a loop is running its first iteration and provide some way to test for that.
moon-child what is a High Level Language? 01:48
01:54 kvw_5_ joined, jmcgnh left 01:58 kvw_5 left 02:05 jmcgnh joined
Xliff moon-child: Anything that is not considered the base run-time. 02:09
Depends on the context.
For bare metal it means anything written in something other than ASM
MoarVM is considered run-time so NQP isn't quite considered High Level, but Raku is.
02:11 frost-lab joined 02:14 aborazmeh left 02:19 marcusr left, marcusr joined 02:32 softmoth left 02:52 Xliff left 03:38 Black_Ribbon joined 03:51 mahafyi joined 04:25 xinming joined 04:28 xinming_ left 04:41 oneeggeach joined, oneeggeach left 04:54 wamba joined 05:05 jmerelo joined 05:15 rindolf joined 05:16 aluaces joined 05:18 wamba left 05:23 wamba joined 05:31 sno joined 05:33 [Sno] left 05:55 parabolize left 06:12 kurahaupo left 06:15 kurahaupo joined
Geth doc: af682314b1 | (Stoned Elipot)++ (committed by Juan Julián Merelo Guervós) | doc/Type/Supply.pod6
Note ms granularity for Supply.batch ref #3744
doc: 8d298872e0 | (Stoned Elipot)++ (committed by Juan Julián Merelo Guervós) | doc/Type/Supply.pod6
Use a more appropriate tense
06:35 stoned75 joined 06:38 domidumont joined 06:41 frost-lab left 06:52 ufobat joined 07:00 sno left 07:04 sno joined 07:06 Sgeo left 07:07 abraxxa1 left, abraxxa joined
andinus .tell tonyo was away 07:10
tellable6 andinus, I'll pass your message to tonyo
07:11 sno left 07:13 sno joined 07:17 kurahaupo left, kurahaupo joined, db48x left 07:18 sno left 07:19 sno joined 07:23 dakkar joined 07:25 sno left 07:27 sno joined 07:32 sno left 07:35 sno joined, brtastic joined 07:37 kurahaupo left 08:12 sena_kun left 08:13 sena_kun joined 08:14 sno left 08:18 domidumont left 08:19 sno joined 08:20 Xliff joined 08:23 sno left 08:24 kurahaupo joined 08:30 kurahaupo left, kurahaupo joined 08:31 pecastro joined 08:44 frost-lab joined 09:03 sena_kun left 09:05 sena_kun joined 09:25 kurahaupo left 09:26 Black_Ribbon left, kurahaupo joined 09:31 frost-lab left 09:33 kurahaupo left 09:36 db48x joined 10:20 natrys joined 10:23 jmcgnh left 10:33 asymptotically joined 10:35 jmcgnh joined 10:36 brtastic1 joined 10:37 brtastic left, brtastic1 is now known as brtastic 10:39 wamba left, wamba joined 10:53 m_athias left, m_athias joined 11:14 titsuki joined 11:47 marcusr left, marcusr joined 12:00 mahafyi left 12:04 kurahaupo joined 12:19 wamba left 12:20 wamba joined 12:21 kurahaupo left
kawaii How do I merge two Sets? I need an array-like structure with no duplicates so I figured Set was the best choice. 12:24
MasterDuke m: say set(1, 2) (|) set(1, 2, 3) 12:26
camelia Set(1 2 3)
lizmat m: dd <a b c d> (|) <d e f> 12:27
camelia Set.new("b","c","f","e","a","d")
kawaii ah, pipe!
thanks :)
lizmat with parens!
m: dd (<a b c d>, <d e f>).flat.unique # without Sets, but with set semantics 12:29
camelia ("a", "b", "c", "d", "e", "f").Seq
lizmat kawaii ^^ 12:30
kawaii Oooo, thank you, this might be useful too!
12:32 kurahaupo joined 12:34 MasterDuke left 12:35 xelxebar_ left 12:36 xelxebar joined
kawaii Am I interpreting TWEAK correctly here? If I'm making a class, and then a user creates an object to use the methods etc within my class, when the object is initialised any code in the TWEAK block will be run at that moment? 12:38
lizmat well, in general, yes, unless you create your own .new method
12:39 MasterDuke joined
lizmat and that .new method doesn't do a self.bless(...) 12:39
12:41 kurahaupo left
kawaii lizmat: so, given my understanding above, my method here, register-termination-points, will run when the user creates an object like `my $m = Mint.new();`, and also allow the user to manually run that method if they wish to add any of their own into the produced set? www.irccloud.com/pastebin/FnMQP7wY/ 12:45
lizmat kawaii: what attributes is that class supposed to have? I don't see any ? 12:48
kawaii lizmat: sorry, it's supposed to be `has $termination-points` and to be populated by the method in the tweak 12:51
`has $termination-points = self.register-termination-points;` I think that would be 12:52
oh, so I don't need a tweak at all here
lizmat then please adapt your gist so I can make a better assessment of what you're trying achieve
yeah, looks like, if you trust the user to always provide valid termination points 12:53
MasterDuke m: sub a($b = Empty) { (1, 2) (|) $b }; say a(4); say a();  # kawaii if you default the parameter to Empty you don't need the if
camelia Set(1 2 4)
Set(1 2)
MasterDuke slip also works 12:57
kawaii if I `return $.termination-points;`, this will then overwrite my class attribute correct? 13:07
13:11 MasterDuke left 13:13 MasterDuke joined 13:24 ufobat left 13:37 frost-lab joined 13:39 frost-lab left 13:43 PimDaniel joined, kurahaupo joined
PimDaniel \o I did yet ask the question but this subject is still stalled for me: 13:43
1st of all : in which OS(es) all of you are using Raku? 13:44
Mine is Linux. Are many of you using Linux or not? 13:45
MasterDuke linux
El_Che linux as well 13:47
lizmat MacOS and Debian
Debian being the "production" environment for me
and MacOS the dev environment
El_Che a little on macos, but not much since I use it more as an expensive type machine 13:48
PimDaniel I'm on Debian too, since 1999 probably. Okay so may you look at that : github.com/Pim-tech/Orthogon/blob/...p.rakumod, plus make it work! I know it require a few time. I think MacOs could be suited to my needs too.
My question is an algorithm question : not a Raku one. 13:49
But i could found an answer or where to search, so .... 13:50
El_Che afk
13:51 kurahaupo left
PimDaniel Hooo it is not the good link, sorry: the whole code is : github.com/Pim-tech/Orthogon 13:51
13:52 parabolize joined
PimDaniel the 1st link : HopcroftKarp.rakumod is a rewriting of this algorithm (Hopcropft and Karp) from Python to Raku by myself. 13:52
lizmat ... 13:53
PimDaniel There are of course probably many optimizations to do on this code but it works.
13:54 moritz_ joined, moritz left
PimDaniel Now here comes my problem and the question: I,'ve transform the polygon to a set of rectangles this way: draw the Vertical and Horizontal cuts, reduce them by HopKorp and Karp algoritm. Add the cuts on concave angles, But now i can NOT found an easy way to fill the rectangles. 13:58
This is the ultimate final step.
To build the the polygon from the terminal, i've began a trace tool. At the end theses tools and the global polygon drawer will use box drawing characters automatically, but this is not a problem and not the priority. 14:01
The corresponding subject is described here: stackoverflow.com/questions/591929...68#6634668 14:03
14:04 stoned75 left 14:06 stoned75 joined
PimDaniel But the algorithm i search could be resume as: How to fill a set of puzzeled rectangles. 14:10
The data given to define theses puzzeleded rectangles may be points or lines. 14:12
14:14 MasterDuke left
PimDaniel Hope i was clear. 14:14
14:14 MasterDuke joined
lizmat PimDaniel: I think your question requires people getting into that problem, which would take significant effort here for most 14:17
and most people here are also busy doing other things
so there's a good chance this question will get warnocked
jdv79 lizmat: i forgot to ask earlier - where is this "EXPORT:refine" stuff supported? i grepped around and i couldn't find anything. 14:20
14:20 sena_kun left
lizmat jdv79: only one module in the ecosystem so far: modules.raku.org/dist/Interval:cpan:ELIZABETH 14:21
14:22 sena_kun joined
jdv79 but how does that work? i couldn't find it in moar or nqp of rakudo... 14:23
14:26 PimDaniel left, gordonfish left
lizmat jdv79: it doesn't need anything extra in core for it to work 14:30
that's the nice part of it :-)
14:30 wamba left
lizmat modules.raku.org/dist/Interval:cpa...al.pm6#L30 is the real trick 14:31
jdv79 cool. i don't understand how it works.
lizmat in the scope of the module, I've defined a subclass of DateTime
whenever I say use module :foo, then anything in the EXPORT:foo stash will be exported 14:32
BEGIN EXPORT::refine::<DateTime> := Interval;
make sure that there is a "DateTime" key in the EXPORT::refine stash
and that it is really the "local" Interval class
so this creates a lexical DateTime entry in the scope where the use is done 14:33
that *isn't* the core's DateTime, but the Interval class from the module
14:33 gordonfish joined
jdv79 oh... i guess i should re-read about export and friends. that's crazy. 14:35
14:44 natrys left, natrys joined 14:50 Sgeo joined 14:53 wamba joined 15:06 aindilis joined 15:20 natrys left 15:28 kurahaupo joined 15:36 natrys joined 15:37 brtastic left 16:05 MasterDuke left 16:21 domidumont joined 16:26 dakkar left 16:33 domidumont left 16:57 simcop2387 is now known as metabot, metabot is now known as simcop2387 17:04 abraxxa1 joined 18:11 sourceable6 left, notable6 left, benchable6 left, unicodable6 left, releasable6 left, committable6 left, tellable6 left, squashable6 left, coverable6 left, shareable6 left, statisfiable6 left, quotable6 left, bisectable6 left, greppable6 left, bloatable6 left, unicodable6 joined, coverable6 joined, statisfiable6 joined 18:12 greppable6 joined 18:13 releasable6 joined, benchable6 joined 18:30 dogbert17 left, codesections joined 18:31 dogbert17 joined 18:32 dogbert11 joined 18:34 vrurg left 18:35 dogbert12 joined, aborazmeh joined, vrurg joined 18:36 dogbert17 left 18:38 dogbert11 left 18:45 abraxxa2 joined, abraxxa1 left 18:51 wamba left 19:00 titsuki left 19:02 cosimo left 19:03 abraxxa2 left 19:06 john_parr joined 19:08 jmerelo left, MasterDuke joined 19:10 abraxxa1 joined 19:12 aborazmeh left 19:15 wamba joined, abraxxa1 left, abraxxa left 19:16 asymptotically left 19:30 dogbert17 joined 19:32 abraxxa joined, dogbert12 left 19:53 Tirifto[m] left 19:54 draco100[m] left, kiti_nomad[m] left 19:55 draco100[m] joined 19:56 kiti_nomad[m] joined 19:57 Tirifto[m] joined, abraxxa left 19:59 natrys left, MasterDuke left 20:05 MasterDuke joined 20:12 natrys joined 20:14 aborazmeh joined 20:21 natrys left 20:36 natrys joined 20:41 ServerStatsDisco joined 20:46 natrys left 20:47 kurahaupo left 20:49 aborazmeh left, kurahaupo joined 21:25 LizBot left 21:27 lizmat left 21:30 kurahaupo left 21:35 kurahaupo joined, lizmat joined 21:55 LizBot joined 22:04 b2gills left 22:12 netrino joined 22:26 kurahaupo left 22:29 LizBot left, lizmat left, lizmat joined 22:31 LizBot joined 22:34 kurahaupo joined 22:35 ComputerTech left, aborazmeh joined 22:39 wamba left 22:52 Kaiepi left 23:00 aborazmeh left, aborazmeh joined 23:05 Black_Ribbon joined 23:14 kurahaupo left 23:16 Util left 23:36 aborazmeh left, kurahaupo joined 23:41 kurahaupo left 23:46 LizBot left, lizmat left 23:47 pecastro left 23:49 kurahaupo joined