🦋 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:04 librasteve_ left 00:53 Guest12 joined
leont Problem on my side, I needed to flatten the hyper 00:54
00:58 Some-body_ joined 00:59 DarthGandalf left 01:02 Some-body_ is now known as DarthGandalf 01:55 silug joined 02:01 hulk joined 02:02 kylese left 02:12 Sumater joined 02:15 hulk left, kylese joined 02:42 human-blip left 02:46 Sumater left 03:01 human-blip joined 03:07 human-blip left 03:24 frankthetank358 left 03:45 kylese left 03:48 kylese joined 03:51 stanrifkin_ joined 03:53 stanrifkin left 04:11 wayland joined 04:12 wayland76 left 04:17 human-blip joined 04:21 Aedil joined 04:58 human-blip left 05:02 human-blip joined 05:08 human-blip left 05:10 human-blip joined 05:25 guifa joined, guifa_ left 05:29 guifa left 05:34 guifa joined 06:05 yeahitsme joined 06:28 guifa left 06:31 guifa joined 09:09 jjido joined 09:15 librasteve_ joined 09:47 Sgeo left 10:39 jjido left, Xliff joined
Xliff m: package one { my @one-exports is export = <A B C>; }; package two { sub two is export { MY::.keys.gist.say }; two 10:40
camelia ===SORRY!=== Error while compiling <tmp>
Can't apply trait 'is export' on a my scoped variable. Only our scoped variables are supported.
at <tmp>:1
------> package one { my @one-exports is export<HERE> = <A B C>; }; package two { sub two is
…
tellable6 2025-05-17T06:40:46Z #raku <wayland> Xliff: I haven't managed to isolate it (it's in a 7000 line codebase). I'm running it in a docker container now, and getting more sensible errors.
10:40 apac joined
Xliff m: package one { our @one-exports is export = <A B C>; }; package two { sub two is export { MY::.keys.gist.say }; two 10:40
camelia ===SORRY!=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> wo is export { MY::.keys.gist.say }; two<HERE><EOL>
expecting any of:
statement end
statement modifier
statement modifier loop
Xliff m: package one { our @one-exports is export = <A B C>; }; package two { sub two is export { MY::.keys.gist.say }; }; two 10:41
camelia WARNINGS for <tmp>:
Useless use of two symbol in sink context (line 1)
Xliff m: package one { our @one-exports is export = <A B C>; }; package two { sub two is export { MY::.keys.gist.say }; }; two()
camelia ===SORRY!=== Error while compiling <tmp>
Type is marked generic but can't be resolved without a generic context
at <tmp>:1
------> export { MY::.keys.gist.say }; }; two()<HERE><EOL>
Xliff m: package one { our @one-exports is export = <A B C>; }; package two { our sub two is export { MY::.keys.gist.say }; }; two()
camelia ===SORRY!=== Error while compiling <tmp>
Type is marked generic but can't be resolved without a generic context
at <tmp>:1
------> export { MY::.keys.gist.say }; }; two()<HERE><EOL>
Xliff m: package one { our @one-exports is export = <A B C>; }; package two { our sub two { MY::.keys.gist.say }; }; two()
camelia ===SORRY!=== Error while compiling <tmp>
Type is marked generic but can't be resolved without a generic context
at <tmp>:1
------> sub two { MY::.keys.gist.say }; }; two()<HERE><EOL>
Xliff m: package one { our @one-exports is export = <A B C>; }; package two { our sub three { MY::.keys.gist.say }; }; three 10:42
camelia ===SORRY!=== Error while compiling <tmp>
Undeclared routine:
three used at line 1
Xliff m: package one { our @one-exports is export = <A B C>; }; package two { our sub three { MY::.keys.gist.say }; }; two::three
camelia ($¢ $! $_ $/)
Xliff m: package one { our @one-exports is export = <A B C>; }; package two { our sub three { OUTER::MY::.keys.gist.say }; }; two::three
camelia (&three ::?PACKAGE $_ $?PACKAGE)
Xliff Odd. I can't do that for two different file-based compunitsa 10:44
What is the top level symbol table where I can access all exported symbols?
10:52 LainIwakura joined 11:07 LainIwakura left 11:40 lichtkind joined 11:50 librasteve_ left 12:03 El_Che left
Guest12 I'm slightly unclear what you're looking for, but maybe EXPORT::ALL::. I don't recall if there's any difference between EXPORT:: and UNIT::EXPORT::, and last I knew separate files were separate compunits, so I don't know if it will work for your use case. docs.raku.org/language/modules#UNIT::EXPORT::* 12:03
m: package one { our @one-exports is export = <A B C>; }; package two { our sub three { EXPORT::ALL::.keys.gist.say }; }; two::three
camelia (@one-exports)
12:04 El_Che joined 12:07 apac left
Xliff Thanks!~ 12:19
Guest12 you're welcome 12:20
Xliff m: EXPORT::ALL::.pairs.gist.say 12:22
camelia Could not find symbol '&ALL' in 'EXPORT'
in block <unit> at <tmp> line 1
Xliff Hmm...
m: package a { sub b is export { EXPORT::ALL::.pairs.gist.say }; }; b
camelia ===SORRY!=== Error while compiling <tmp>
Undeclared routine:
b used at line 1
Xliff m: package a { our sub b is export { EXPORT::ALL::.pairs.gist.say }; }; b
camelia ===SORRY!=== Error while compiling <tmp>
Undeclared routine:
b used at line 1
Xliff m: package a { our sub b is export { EXPORT::ALL::.pairs.gist.say }; }; a::b
camelia Could not find symbol '&ALL' in 'EXPORT'
in sub b at <tmp> line 1
in block <unit> at <tmp> line 1
Guest12 looks like UNIT:: is necessary after all 12:24
m: package a { our sub b is export { UNIT::EXPORT::ALL::.pairs.gist.say }; }; a::b
camelia (&b => &b)
Guest12 btw fwiw, say calls gist implicitly, unlike print which calls Str 12:29
m: package a { our sub b is export { UNIT::EXPORT::ALL::.pairs.say }; }; a::b
camelia (&b => &b)
12:53 jjido joined
tbrowder I was very wrong, cancelled the App::Mi6 issue, problem was current Raku cannot handle =begin/=end rakudoc delimiters even though raku --help implies it can by offering the --rakudoc option 12:53
filed issue with rakudo #5881 12:55
Xliff m: package a { our sub b is export { UNIT::EXPORT::ALL::.pairs.gist.say }; }; a::b 13:26
camelia (&b => &b)
Xliff Guest12++
Guest12 on behalf of whoever randomly gets this nick next, thanks for the karma :) 13:31
14:17 Aedil left 14:21 yeahitsme left 14:24 Aedil joined 14:42 jjido left
lucs Given ‹sub baz { say 'out'; note 'err' }›, is there a way to invoke ‹baz()› while capturing all that output into a string, printing nothing to $*OUT and $*ERR? 14:47
Nahita: Aha, thanks, that appears to work fine. 15:18
A lot of stuff going on there, neat.
15:26 jjido joined
nahita3882 np 15:30
coranila m: role SayRouter { method say(*@, *%_) { print "printing to file.. "; nextsame } }; $*OUT does SayRouter; $*OUT.say: "hi" 16:06
evalable6 printing to file.. hi
Raku eval printing to file.. hi
coranila that doesn't directly overwrite &say though 16:07
not sure why at a glance, actually
oh, probably cause bare &say calls &say(Handle:D: |C) 16:12
16:21 vrurg left, vrurg joined
Voldenet trying to override "say" doesn't sound like a good idea to me, in fact using "say" for logging is a bit of code smell too 16:31
coranila everything's allowed in a local interpreter 0:-) 16:33
Voldenet in fact, $*OUT should support things like .encoding 16:34
otoh
coranila but yeah, i don't disagree; i'm pretty sure my solution in a module might leak and cause problems elsewhere
Voldenet $*logger doesn't have to support anything but 'role Logger { method log }`
coranila adding mixins to dynamics seems like it might add spooky action at a distance
Voldenet …but it's even scarier up close? :> 16:36
coranila hm actually why not just do like { my $*OUT = my $*ERR = "outerr.log".IO; baz() }
that locally overwrites both to a file, which seems to align best with the original question of "redirect both &say and &note to the same file" 16:37
or well, "lexically", not "locally" but still 16:38
..maybe open the Handle too
maybe 16:39
Voldenet: well, i'm local, so spooky action at a distance only minimally influences me via para-causal feedback ;-) 16:40
Voldenet I was about to suggest using unix pipes, which is surprisingly sane solution 16:46
that is, until you notice spawning the process 16:47
coranila even more spooky action at a distance!
quantum computing was the UB we relied on all along
Voldenet I don't, I like keeping my cats alive 16:48
coranila makes me wonder; cats like to sit in squares, which is like pretending to be inside a box... what are they trying to tell us? 16:49
Voldenet that thinking inside the box is a solution 16:50
coranila that implies that real solutions require working in isolation and unobserved 16:51
which in turn implies that a lonely thinker is a quantum oracle
that reminds me of those billions of "solutions" to Collatz' conjecture that just.. .compute numberbs 16:52
grand wizardo Terence Tao already has declared that enumerating all n in N for their stopping time is almost guaranteed to be possible; the remaining uncertainty is just the fact that N is N 16:53
Voldenet >almost guaranteed 17:22
I'm not sinking my time on 3n+1 again, but I like how definite this statement sounds ;) 17:23
17:24 jjido left
coranila well he is a number theorist; he's not gonna derive a universal binary decision algorithm, and collatz' map is a recursive binary choice function 17:34
if wolfram ever finishes a sentence it probably does contain a proof for collatz, i think 17:35
lizmat: i'd need to bump NQP revision to push the '"working"" (with 12 GB heap size..) rakudo-j build, but i can't push the corresponding NQP commits 17:37
tellable6 coranila, I'll pass your message to lizmat
17:37 jjido joined 17:46 Sgeo joined 18:21 apac joined 19:26 Aedil left
antononcube Yes, Wolfram Language should be implemented in Raku. (To get collatz, smollatz, and whatever else…) 19:27
19:29 Geth joined, lizmat_ left, lizmat joined
nahita3882 how to get it into a string, read the file back? 19:31
also why mys are necessary for dynamics, what do they mean, why doesn't it work without (or does it?)
Voldenet mys are not necessary for dynamics 19:39
they are necessary for capturing and restoring them
m: my $*X = "first"; sub u { $*X = $^val; p }; sub p { say $*X }; u("second"); p; 19:40
camelia second
second
Voldenet m: my $*X = "first"; sub u { my $*X = $^val; p }; sub p { say $*X }; u("second"); p;
camelia second
first
Voldenet note that subtle difference
nahita3882 thanks 19:42
19:48 timo left
coranila Nahita: you can just store the file name and read it later 19:50
like my $fh = "log.txt".IO.open: :rw; { my $*OUT = my $*ERR = $fh; baz() }; .say for $fh.slurp # or something, i'm not super firm in the IO interface.. 19:51
might have to rewind? probably not..? 19:52
antononcube: i wrote this down a few weeks ago, no idea what to do with it gist.github.com/crnlskn/51bb3539cc...a3b3d9583e 19:54
20:05 timo joined 20:24 apac left 20:25 apac joined 21:19 Guest12 left 21:25 Guest54 joined 21:35 apac left 22:00 stanrifkin_ left 22:13 jjido left
Xliff ab5tract: gist.github.com/Xliff/8e921aac99eb...d76dd07a7e 22:26
ab5tract Xliff: at first glance that seems fine :( 22:31
Xliff Yeah. Should I be using RAKUDO_RAKUAST? 22:38
I mean, I could just EVAL the .DEPARSE, but I don't know how well that would work.
Kinda defeats the purpose.
[Coke] If you're not already using RAKUDO_RAKUAST how are you getting the nodes? 22:52
antononcube @coranila Well, obviously, you can use "Math::CollatzNum" to do some interesting visualizations with Raku. 22:56
See these Number theory "neat examples" : www.youtube.com/playlist?list=PLke...XEsBWtHWzN 22:58
23:12 wayland left 23:32 lichtkind left 23:40 tjr left