🦋 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.
Xliff_ \o 01:26
How can I run an external command in raku and have the commands output still pass through to STDOUT without buffering or capturing? 01:27
antononcube @Xliff If I understand correctly the question, you have to call shell. 01:30
Xliff_ Thanks! 01:34
ugexe That is not correct 02:17
Well maybe it is actually im 02:18
not sure
I’m not sure how using shell would rather 02:20
would help rather ^
antononcube @ugexe Right, I was not sure about the question and hence proposed solution. I go often through the following "bargain" : 1) first I try to use shell , 2) then I try to use run, 3) finally, I end up using Proc::Async. 02:30
melezhik Xliff: does not actually matter which method you use to execute command, the issue relates to STDOUT buffering flushing 08:01
$*ERR.out-buffer = False; 08:02
$*STD.out-buffer = False;
the way you go
actually $*OUT.out-buffer = False; 08:04
greenfork How can I forward-declare a role to be used for an enum? I'd like this example to work paste.sr.ht/~greenfork/99c817d403e...9b5830d2a6 11:14
lizmat you can't 11:20
lizmat enums are compile time constructs, so all logic to create the enum *must* exist when the enum is declared 11:21
perhaps there's another way to do what you want to do? feels like your question was an X-Y problem question 11:22
greenfork Basically I want to do something like this Surface::Fire.draw 11:24
I think this is the closest code paste.sr.ht/~greenfork/f10f0f0670f...cf3b6b3e76 11:25
I also posted on stackoverflow this question, will answer it myself after figuring out the optimal solution I think stackoverflow.com/questions/787930...or-an-enum
lizmat that works, so what's wrong with it? 11:26
greenfork Nothing wrong, I just don't like the way it is written 11:27
My other classes are like class A { method draw { ... } }, so they are all called like $a.draw, I wanted to have a similar interface for the enum 11:28
But I think that it requires wrapping it in a class
[Coke] you can pun a class into that role. 12:57
m: role DrawSurface { method draw($a) { say $a } }; my $b = DrawSurface.new; $b.a("hi") 12:58
camelia No such method 'a' for invocant of type 'DrawSurface'
in block <unit> at <tmp> line 1
[Coke] m: role DrawSurface { method draw($a) { say $a } }; my $b = DrawSurface.new; $b.draw("hi") 12:59
camelia hi
[Coke] so if you want an instance var, you can still make one, even if it's a role not a class.
antononcube I think we can also make a class that does the role Enumeration? (I am not in front a computer, I am just reading the enum documentation on my iPad.) 13:05
[Coke] Yes, you can do it manually too of course. 13:41
m: role DrawSurface { method draw($a) { say $a } }; class C does DrawSurface {}; my $b = C.new; $b.draw("hi") 13:42
camelia hi
[Coke] you basically get an anonymous C in the first example.
[Coke] greenfork: hope that helps. 13:54
greenfork [Coke]: this is interesting, thank you for tagggin me! 13:56
xinming Hi, Is it possible that we use PSGI in Cro? 18:57
jdv why? 19:00
it was talked about a bunch years ago, psgi and raku that is. 19:01
what is justification?
antononcube Is "PSGI" in Raku going to be called "RSGI"? 19:02
jdv afaik, the general psgi/raku thing went nowhere 19:03
xinming Ok, I just check my old test utility written in perl, I have TODO to say upgrade to PSGI, which reminds me about PSGI thing in raku support. :-) 19:40
antononcube @ximming Do it, ximming! Do it! 20:08