🦋 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.
[Coke] m: dd List.new 01:28
camelia () 01:28
[Coke] m: dd Array.new 01:29
camelia Array element = []
[Coke] m: dd Str.new
camelia ""
[Coke] m: dd List
camelia List
[Coke] m: use nqp; dd nqp::hlllist
camelia ()
[Coke] m: use nqp; dd nqp::hllhash
camelia Hash element = {}
melezhik chloekek: I made a proposal on possible usage of Sparrow in CRAI provision/deployment. Appreciate your feedback. github.com/chloekek/crai/issues/24 02:54
tellable6 melezhik, I'll pass your message to chloekek
hungrydonkey Hello everyone, I just started to learn raku. How to get the nth character of a string ? Like : my $str = "Hello Raku", I want to get the third character of $str. How can I do it? 04:35
moritz hungrydonkey: with substr 04:49
m: my $str = "Hello Raku"; say $str.substr(2, 1)
camelia l
moritz (the 2 because raku starts counting at 0) 04:50
and 1 for the numbers of characters you want to extract
hungrydonkey Oh, that's cool! Thank you, Moritz. 04:54
Geth doc: 5acc3f5a70 | (Patrick Böker)++ (committed using GitHub Web editor) | doc/Language/concurrency.pod6
Replace a "Perl" with "Raku"
08:38
linkable6 Link: docs.raku.org/language/concurrency
Altreus I feel like I keep asking this but I keep confusing myself so I hope you'll forgive me - does 'done' act like 'return' inasmuch as the following statements won't be run? 08:53
ismustachio @Altreus from docs: Within a Supply block, it will indicate the supply will no longer emit anything. See also documentation on method done. 09:03
docs.raku.org/routine/done
sena_kun Altreus, yes 09:05
m: start react supply { say 42; done; say 42; }; sleep 1;
camelia ( no output )
sena_kun erm 09:05
m: await start react supply { say 42; done; say 42; }
camelia ( no output )
sena_kun erm
m: react whenever supply { say 42; done; say 42; } 09:06
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block (whitespace needed before curlies taken as a hash subscript?)
at <tmp>:1
------> 3henever supply { say 42; done; say 42; }7⏏5<EOL>
expecting any of:
block or poin…
sena_kun ok, morning, you got me
m: react whenever Supply.interval(1) { say $_; done; say 42; } 09:09
camelia 0
sena_kun Altreus, ^
Altreus nice thank :) 09:18
Altreus Does there exist a module that will trace all method calls? Perhaps one that I can filter to certain namespaces? 10:00
tadzik hmm, I seem to recall Devel::Trace being a builtin pragma... 10:01
I seem to remember wrong though
jnthn Altreus: modules.raku.org/dist/Trait::Traced:cpan:KAIEPI maybe 10:02
Though if you're trying to understand concurrent stuff I tend to use modules.raku.org/dist/Log::Timeline:cpan:JNTHN
Hm, the status info on that page is actually out of date
Altreus splendid! 10:03
jnthn (the upcoming stuff upcame)
Altreus Forever grateful for the work of people more knowledgeable than I
which always seems to be either lizmat or jnthn
but ok
I love the idea of a role that traces 10:05
now I can add it to the websocket and see what happens
Kaiepi Trait::Traced traces all method calls to a type when applied to one, one the condition that they exist in its method tables somewhere
s/one/on/
jnthn Well, Trait::Traced isn't lizmat or I, but Kaiepi++ :) 10:06
lizmat indeed!
Altreus Indeed Kaiepi++ 10:07
Kaiepi :)
jnthn Log::Timeline I guess I'm guilty for though :)
Altreus DO droplets are kind of clunky huh
should probably not do this sort of heavy debugging on one of them 10:08
dakkar re: Log::Timeline, be aware of github.com/jnthn/p6-log-timeline/issues/8
Altreus also I love but 10:10
>_>
don't say that out loud 10:11
Ah, suddenly the difference between "trait" and "role" is driven home to me 10:14
Altreus If I put «is traced» on Cro::WebSocket::Client I get «Serialization Error: missing static code ref for closure '' (gen/moar/World.nqp:2594) 10:21
»
from the «use Cro::WebSocket::Client» line in my code
Kaiepi yeah that's a bug in the current release
Altreus :<
well
Kaiepi the fix for it i have atm depends on the next release of rakudo 10:22
Altreus I'm editing the websocket code - I'll just stick more print debugging in :D
Determined to find this problem!
jnthn tries to remember if he already put timeline probes into Cro::WebSocket or not... 10:23
Altreus unsure how to recognise them
Kaiepi there is a way you can trace any method call on a type similarly to how Trait::Traced does without the module, just it's a bit annoying to write 10:25
gimme a sec
Altreus I'm not yet sure what traces I want anyway :D 10:40
Currently I have a note before and after many many lines in my own code
trying to figure out which bit is running and which bit is hanging 10:41
Kaiepi Altreus, this should trace all method calls to methods a type declares fpaste.scsys.co.uk/588661 10:42
in a way that works with older releases
Altreus *paw*
Kaiepi the only reason Trait::Traced itself doesn't do something like this in the current release is because it doesn't work (yet) with multi methods 10:43
Altreus does it have to be a trait? I mean since it composes an anonymous role, can I just make it nonymous and compose it on the object?
Kaiepi you can do it like that if you want 10:44
Altreus i try 10:45
gonna wait for the thing to fail before I restart it with this 10:48
Kaiepi btw, how were you using Trait::Traced to get that serialization error? 10:49
chloekek .
tellable6 2020-04-22T02:54:59Z #raku <melezhik> chloekek: I made a proposal on possible usage of Sparrow in CRAI provision/deployment. Appreciate your feedback. github.com/chloekek/crai/issues/24
Altreus Kaiepi: I cloned cro-websocket and just bunged it in the source 11:51
class Cro::WebSocket::Client is traced { 11:52
then used raku -I to use it :)
Kaiepi ah, that's probably fixed with the upcoming release, but it could use some tests 11:54
Altreus :) 11:59
Kaiepi yep, precomp seems to get handled ok 13:08
Altreus hrm I think I need to do a sort of pointer-to-pointer thing except with supplies 15:19
Altreus Is there an idiom I can steal so I don't have to figure it out for myself? 15:19
Basically I need to be able to recreate this supply without anything that was tapping it noticing that it stopped github.com/shuppet/p6-api-discord/...n.pm6#L108 15:20
(Cos I might be required to reconnect, which I am doing by creating a new websocket) 15:21
dakkar possibly stupid idea: wrap the real Supply in your own Supply-like class, delegate most behaviour, then switch the real Supply inside when you need to 15:23
timotimo i haven't looked, but it kind of sounds like you want a Supplier that you .emit stuff into from where you get messages from your websockets 15:26
m: my $output = Supplier.new; my $events = $output.Supply; start react whenever $events { say "event: $_" }; react whenever Supply.from-list(^3) { $output.emit("first: $_") }; react whenever Supply.from-list(5..8) { $output.emit("second: $_") }; sleep 0.5 15:27
camelia event: first: 0
event: first: 1
event: first: 2
event: second: 5
event: second: 6
event: second: 7
event: second: 8
timotimo Altreus: what do you think? 15:28
Altreus Yeah, I started to think that maybe instead of setting it to a supply {} I use a Supplier that I can just call emit on 15:35
But then I thought hang on, didn't I have that? 15:36
I refactored it not to :o maybe this is why it was like that
I'm gonna try it
turns out it was only 3 lines 15:38
timotimo there's also migrate, if that's the right name
where you push a supply of supplies and it'll always take items from the last supply it got
Altreus hmm 15:41
Altreus oh I see! 15:43
docs.raku.org/type/Supply#method_migrate
So I can just emit the supply I currently have and call migrate on the supply 15:44
lemme try
Altreus Ah, but I emit the first supply before anything starts tapping it, and therefore migrate isn't called 15:49
So nothing happens
Hrm I expect it to do something but it doesn't 15:52
annoyingly I've elected to hack at an http clone of my repo so I can't just push my changes :)
I have $!messages-supplier.emit: supply { note "Starting message supply" ... } but I don't get the note 15:53
I think that pattern is more complex than just start react whenever { ... $!messages.emit } 15:55
Altreus I think I have a bad design here 16:02
I've conflated supply and react
~ sort of
I think when I turned it into a supply I ignored the fact that it was really a react where *one* of the outcomes *happened* to be to emit the data 16:03
Same way a map is not a foreach
melezhik2 Hi chloekek: did you happen to see my Sparrow suggestion for CRAI? 16:18
in nutshell I trying to see if imperative, traditional CM tool could be fit for CRAI provision/cm/deploy 16:19
Geth doc/makefile-cleanup: 8a1c78ea4c | (Stoned Elipot)++ | Makefile
remove references to removed make targets

refs #2996
16:20
doc: stoned++ created pull request #3345:
remove references to removed make targets
16:21
melezhik2 I've got others idea of embedding Sparrow into Nix packages, so we could run Sparrow tasks Nix natively, :-) but that's another story ... I just started with something simple 16:23
Geth doc: 8a1c78ea4c | (Stoned Elipot)++ | Makefile
remove references to removed make targets

refs #2996
17:28
doc: 3320a13642 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | Makefile
Merge pull request #3345 from Raku/makefile-cleanup

remove references to removed make targets
linkable6 DOC#2996 [open]: github.com/Raku/doc/issues/2996 [big][build][meta] Remove htmlify.p6
stoned75 :q 18:58
El_Che stoned75: there is no escape 19:00
stoned75 C-x-C-c 19:04
Manifest0 Is there a way to specify "dynamic" subsets? 19:59
For example i would like something like this "subset ($a+)n of Str where $a ~~ /\d/ $_.chars == $a"
:-)
timotimo kind of like a parameterized subset? 20:10
Manifest0 yes. I would like then to do "my 29n $var;" or "my 10n $var='abcdefghij'" 20:13
timotimo ah, not exactly like that i think 20:15
Manifest0 and if set the var with a length higher than the number in the begining it would throw an error :-)
melezhik vrug: Test-Async test fails on rakudist , I know this is a an old problem, FYI - repo.westus.cloudapp.azure.com/raku...585441.txt 20:31
vrurg: Test-Async test fails on rakudist , I know this is a an old problem, FYI - repo.westus.cloudapp.azure.com/raku...585441.txt
vrurg melezhik: thanks, will look at it later today! 20:33
melezhik sure, NP
[Coke] Manifest0: I would write a sub that took a parameter and then do ... where my-check(param1) and where my-check(param2) 21:46
Demos[m] does IO::Path.open(:exclusive) ACTUALLLY fail if the file exists or just if another process has the file open? 22:54
vrurg .tell melezhik regarding the failing test – the actual test did not run. It was p6doc dependecy which failed to install. It probably should not happen. 23:16
tellable6 vrurg, I'll pass your message to melezhik
melezhik2 vrurg: I know this is not the module's blame. but it is still an error, and it bound to be, this is an old bug with p6doc 23:28
tellable6 2020-04-22T23:16:56Z #raku <vrurg> melezhik regarding the failing test – the actual test did not run. It was p6doc dependecy which failed to install. It probably should not happen.